Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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".



Right. 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.


Most 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.


That's because you write string search programs. Do those even need to run in UTF-8 space, as opposed to pure byte strings?


If 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: