mosra / corrade

C++11 multiplatform utility library
https://magnum.graphics/corrade/
Other
482 stars 105 forks source link

Opt-in to native UTF-8 support for OS interaction on Windows #156

Open mosra opened 1 year ago

mosra commented 1 year ago

From discussion with @williamjcm and @sthalik on Gitter. To avoid UTF-16 conversion in every Utility::Path API that deals with the filesystem on Windows (and other areas, like environment access), we could pass UTF-8 support directly into the A APIs. It's an opt-in feature, and there's three ways to achieve this:

The second option could be done inside CorradeMain, the third variant documented alongside HiDPI support, for example. Then, all Path APIs would check the prerequisites (Windows version, UCRT vs MSVCRT, and if the codepage is set to UTF-8) and pick a more optimal path in that case.

TODOs left: