News for hackers. Stuff that matters.
Re:cuneicode, and the Future of Text in C by comex on Wednesday June 07, 2023 @01:16PM (#36229889)
Correct – but that’s exactly why you can’t just say “all strings are UTF-8, we’re done here”. Because Windows filenames can contain unpaired surrogates, which don’t have a sensible UTF-8 translation. (Unix has a similar problem with filenames being arbitrary bytes that may not be valid UTF-8.)

Note that Rust has OsString to handle both of these cases, but it’s somewhat hard to use.

Re:cuneicode, and the Future of Text in C by masfuerte on Wednesday June 07, 2023 @02:27PM (#36231203)
With networking code you sometimes need an OsString for the platform you're not on. Rust doesn't seem to support this, other than by writing your own.