aseprite / laf

A C++ library to create desktop applications
https://aseprite.github.io/laf/
MIT License
276 stars 60 forks source link

UTF-8 on Windows #47

Open dacap opened 1 year ago

dacap commented 1 year ago

Just yesterday I was investigating about the possibility to enable UTF-8 support on the console (using SetConsoleOutputCP(CP_UTF8)): https://github.com/aseprite/laf/commit/ad8cf4929f5effab88cc393b7d9534d32a65de8d

But I'm not sure if this should be done by default. Even more, we could add support to use ANSI version of functions which can support UTF-8 directly (if we embed a special manifest file): https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page#set-a-process-code-page-to-utf-8

In this way we could avoid the from_utf8/to_utf8 conversions on each Win32 API call (https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page#-a-vs--w-apis).