3 ms·
> most mainstream programming languages store unicode strings in memory as UTF-16 Uh. What languages do you have in mind? C/C++ don't have any preference for
by loeg 3y ago
> most mainstream programming languages store unicode strings in memory as UTF-16
Uh. What languages do you have in mind? C/C++ don't have any preference for UTF-16. Python3 doesn't use UTF-16. As you mentioned, Rust doesn't.
- steeleduncan 3y agojava, .net, apple ecosystem (i.e. swift/objc),...
- Longhanks 3y agoSwift is UTF-8 since 2019 https://www.swift.org/blog/utf8-string/ https://www.swift.org/blog/utf8-string/
- grishka 3y agoJava, C# and the rest of .net, JavaScript, Swift/ObjC. C/C++ don't have a preference but, for example, if you're writing for Windows, you'd probably want to use wide characters. I'm not sure what kind of strings Linux GUIs use but I suspect it's wide characters as well.
- MatmaRex 3y agoIn addition to the examples already given, JavaScript as well (although modern implementations do wacky stuff with the internal representations, the APIs are required to expose only UTF-16).