4 ms·
When I see a commit like https://github.com/brianluft/heirloom/commit/445ea8ef7018ef02540227591d1aa6ebfa8936ef https://github.com/brianluft/heirloom/commit/445e
by JdeBP 1y ago
When I see a commit like https://github.com/brianluft/heirloom/commit/445ea8ef7018ef02540227591d1aa6ebfa8936ef https://github.com/brianluft/heirloom/commit/445ea8ef7018ef0... , I am convinced that yes, this is the original source code. (-:
https://github.com/brianluft/heirloom/commit/3001b284130c399a710959e47e2f8814f7f05390 https://github.com/brianluft/heirloom/commit/3001b284130c399... is rather interesting. Not only for all of the implicit type conversions that the code turned out to be doing, but also for all of the things that were dropped.
It is not totally "modernized", though. Its idea of "Unicode only" is using WTF-16 rather than UTF-8 (which is possible on Win32 nowadays with code page 65001).
- arandomhuman 1y agoyikes
- jeroenhd 1y agoCode page 65001 comes with a caveat, though: > GDI doesn't currently support setting the ActiveCodePage property per process. Instead, GDI defaults to the active system codepage. To configure your app to render UTF-8 text via GDI, go to Windows Settings > Time & language > Language & region > Administrative language settings > Change system locale, and check Beta: Use Unicode UTF-8 for worldwide language support. Then reboot the PC for the change to take effect. Source: https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page https://learn.microsoft.com/en-us/windows/apps/design/global... I don't think changing the system settings for one application to work is a great idea, especially as that setting can break other applications. Until Microsoft fixes GDI, I think it'll be a while before UTF-8 is a viable option.
- JdeBP 1y agoNot any more, it does not. You are reading a warning that was put on that page a few years ago. Things have changed over the 6 years since Windows 10 release 1903. In particular, a couple of years later Microsoft was (interestingly, not always but sometimes, and no-one has really pinned down in what exact circumstances) turning that setting on by default in Windows 11.
- electroly 1y agoAuthor here. Indeed, the string handling is all unchanged from the original code, but on modern Windows this is still an acceptable and supported way to handle full Unicode. Try your favorite ZWJ-based emoji outside the BMP.