3 ms·
The nature of warnings means that any time you make assumptions about those that might need the warnings having enough knowledge to correctly assess an ambiguit
by kbenson 9y ago
The nature of warnings means that any time you make assumptions about those that might need the warnings having enough knowledge to correctly assess an ambiguity, you've likely just failed a portion of the people the warning was meant to help.
The correct response when warning people of potential problems is never "oh, they should be able to figure out whether this applies to their case".
- Animats 9y agoRight. The correct answer here is to convert external data into UTF-8 once and keep it that way. You're probably not going to become compute-bound, even if you're just reading in text and writing it out again. The UTF-8 check is linear time.
- burntsushi 9y agoMost of the Rust programs I write are compute bound, and finding ways to avoid the separate UTF-8 validation step are critical to their performance.
- Animats 9y agoThat's because you write string search programs. Do those even need to run in UTF-8 space, as opposed to pure byte strings?
- gpderetta 9y agoIf you are reading text and writing it out you generally do not want to convert to utf8 as it is potentially lossy. Think of unix filters.