3 ms·
Windows finally added support for UTF-8 2 years ago: https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page https://docs.microsoft.
by jhasse 6y ago
Windows finally added support for UTF-8 2 years ago: https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page https://docs.microsoft.com/en-us/windows/uwp/design/globaliz...
- ChrisSD 6y agoTechnically it's had support since (IIRC) Windows 7. What this does is call the translation functions for you instead of having to do it yourself.
- huhtenberg 6y agoConversion functions - MultiByteToWideChar & co. - were in since Windows 2000 and the UTF8 codepage was supported as early as XP if not in W2K as well.
- ChrisSD 6y agoAh thanks! It's funny because I can't recall ever using code page 65001 before 7. Maybe there was a reason for that or maybe I simply didn't know it existed until then. Or maybe I thought it simpler to just use UTF-16. I can't remember.
- gpvos 6y agoIt existed in W2K and maybe even earlier, but there were bugs in the console regarding codepage 65001, so you couldn't use it as the default. This was not fixed yet in XP, maybe in 7 though.
- vbezhenar 6y agoIt is not default configuration and it's marked as "experimental" in UI. I would never enable it for my PC, that's just absurd.
- iudqnolq 6y agoYeah, the "might" here is doing a lot of work > As Windows operates natively in UTF-16 (WCHAR), you might need to convert UTF-8 data to UTF-16 (or vice versa) to interoperate with Windows APIs.
- jhasse 6y agoI mean that application developers can enable it in their manifest and don't have to do UTF-16 <-> UTF-8 conversions anymore.
- vbezhenar 6y agoI thought that's about user choosing UTF-8 as codepage in regional settings. If it could be set in application manifest, that's a good thing. Although I guess that in the end Windows will perform the save conversions in user32.dll, so it does not really matter.
- ChrisSD 6y agoWindows does allow setting it in the application's manifest but it also requires a registry setting to be enabled otherwise the manifest option is ignored. Obviously asking users to edit the registry is a non-starter so it's only used where the developers also control the user environment (e.g. the registry change is deployed through group policies, etc). But yeah, this just tells Windows to do the conversion so that programmers don't have to type out the function calls themselves. It's simple enough to create a wrapper function for Windows API calls in any case.