3 ms·
A lot of people would disagree with you: >This document also recommends choosing UTF-8 for internal string representation in Windows applications, despite the
by n2d4 3y ago
A lot of people would disagree with you:
>This document also recommends choosing UTF-8 for internal string representation in Windows applications, despite the fact that this standard is less popular there, both due to historical reasons and the lack of native UTF-8 support by the API. We believe that, even on this platform, the following arguments outweigh the lack of native support.
https://utf8everywhere.org/ https://utf8everywhere.org/
- jeroenhd 3y agoLinux and MacOS use UTF-8. Qt, Windows itself, Java, Javascript, and (on Windows) C# will all use UTF-16. Most computers run Windows, by a rather big margin. Even more computers use Javascript. Are you running KDE? Don't be surprised if half the text in your screen is secretly UTF-16! UTF-8 is definitely better, but if you're on Windows, you're making your own life harder by using UTF-8. Microsoft is migrating APIs to UTF-8 but it'll take years before that's finished. Just look at all the conversion code you need according to the page you linked. Now, if you're writing a cross platform library, you'll have to decide what encoding(s) you use. I personally don't really see why you wouldn't make your library encoding agnostic, but if you want to stick to one single encoding, you'll have to decide. If you're writing a program for Windows, technical superiority is a mediocre argument for making your own life that much harder. There are tons of formats and design decisions that may be technologically superior, but just end up wasting programmers' time, and this is one of them.
- _8j50 3y agoWindows is not open source, I don't prefer either encoding I am just telling you that as that document acknowledges, UTF-16 is the default whether "everyone" (tech bubble) likes it or not. If you write windows software assume that default, not your favorite utf8. Just like how you assume endianess on a system because of the default.