CelestiaProject / Celestia

Real-time 3D visualization of space.

Home Page:https://celestiaproject.space

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch the Windows front-end to Unicode APIs

ajtribick opened this issue · comments

Currently the Windows front-end is using ANSI APIs, this limits the ability to support certain languages (e.g. Georgian, recently added).

If we still want to keep the Windows front-end around, we should update it to use the wide-character APIs instead.

From https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page:

Win32 APIs often support both -A and -W variants.

-A variants recognize the ANSI code page configured on the system and support char*, while -W variants operate in UTF-16 and support WCHAR.

Until recently, Windows has emphasized "Unicode" -W variants over -A APIs. However, recent releases have used the ANSI code page and -A APIs as a means to introduce UTF-8 support to apps. If the ANSI code page is configured for UTF-8, then -A APIs typically operate in UTF-8. This model has the benefit of supporting existing code built with -A APIs without any code changes.

-W API will also cause problems with gettext.

Using the UTF-8 codepage would be the simplest option, although I believe this requires a minimum of Windows 10 version 1903.

I have some work in progress on converting the win32 UI. It turns out that gettext isn't too much of an issue since we're already having to convert from UTF8 to current codepage.