You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
At present, ÔÇô has a mess of CPP conditionals everywhere that make the engine use “wide strings” for any text handling that ends up in console output, if compiling for Windows. This presents a few problems:
There is no way to fairly draw the line determining whether or not wide strings should be used, because there is no certainty that something may or may not end up printed to the console. The only way to fix this is to use wide strings everywhere, which isn’t always practical or efficient.
It makes a huge mess of things because of the inherent need for conditional compilation, which requires frequent usage of the C Preprocessor.
The only reason it does this at all in the first place is because I was unaware of a certain Windows API command which changes the console’s codepage to UTF-8; currently, it uses other API functions that instead change the console mode to use UTF-16, hence the wide string usage everywhere.
All other targeted platforms should be using narrow strings as it stands already, so this change is mostly concerning Windows-specific code. Let’s keep it simple and use UTF-8 everywhere.
The text was updated successfully, but these errors were encountered:
Most of the encumbered code lies in src/oco/engine/helpers.cpp, but there are other places of issue I'm sure.
When this logging system was built, I mistakenly believed that the Windows console lacked support for UTF-8, and as a recourse I created a system that would change the codepage to use UTF-16LE, performing conversions as necessary.
This doesn't play well with D code, where the notion of text is more sensible. It is also a very time-consuming specialisation for the Windows platform, with many (now redundant) strings and wrapper functions having been made to compensate for this.
The Windows codepage for UTF-8 is 65001, and the Windows API should be used (wrapped in win32.h of course) to make the change on-the-fly. This is going to involve a lot of cleanup and consolidation, but it should save everyone headaches in the long run.
At present, ÔÇô has a mess of CPP conditionals everywhere that make the engine use “wide strings” for any text handling that ends up in console output, if compiling for Windows. This presents a few problems:
All other targeted platforms should be using narrow strings as it stands already, so this change is mostly concerning Windows-specific code. Let’s keep it simple and use UTF-8 everywhere.
The text was updated successfully, but these errors were encountered: