News for hackers. Stuff that matters.
Re:You can't just assume UTF-8 by int_19h on Monday April 29, 2024 @09:29PM (#40206316)
> If you're writing low level code, you have to convert UTF-8 to UTF-16 and back.

It depends. If you're writing an app, just add the necessary incantation to your manifest, and all the narrow char APIs start talking UTF-8 to you.

For a library, yeah.

Re:You can't just assume UTF-8 by ezoe on Tuesday April 30, 2024 @04:45AM (#40208633)
Don't be surprised such UTF-8 locale program will break so bad on Windows with default language set to Japanese.
Re:You can't just assume UTF-8 by int_19h on Tuesday April 30, 2024 @01:41PM (#40213703)
Why would it break? If you just assume that the system codepage is UTF-8, then sure. If you specifically say in your manifest that you want UTF-8, then Windows (10+) will give you UTF-8 regardless of which locale it is:

https://learn.microsoft.com/en-us/windows/apps/design/global...