Rangi42 / tilemap-studio

A tilemap editor for Game Boy, Color, Advance, DS, and SNES projects. Written in C++ with FLTK.
https://hax.iimarckus.org/topic/7691/
Other
383 stars 30 forks source link

Crash on launch in some system locales #25

Closed MandL27 closed 3 years ago

MandL27 commented 3 years ago

When launching Tilemap Studio, either latest release or built from source, on a Windows 10 machine with non-Unicode system locale set to Japanese, the process appears for a couple seconds before abruptly terminating. Launching through Visual Studio produces the following error: image I switched locale back to en-US and everything worked again.

Rangi42 commented 3 years ago

I've previously used tools like AppLocale or Locale Emulator to run Japanese programs on a system with US English as the non-Unicode system locale. Does that help you with Tilemap Studio? Or, are you using a limited set of Japanese programs, and can they be run with a non-default locale instead?

I don't plan on testing or supporting locales for Tilemap Studio. The FLTK library uses UTF-8 internally, which is increasingly standard, and already has to work around some issues with Windows having standardized on UTF-16. (Turns out that C++'s std::ifstream doesn't work with special characters and there's no wide-char equivalent, but FLTK's fl_fopen works correctly... at least for Unicode applications.)

If this is something that you can debug and fix, that doesn't require some kind of locale awareness code added in all sorts of places, I'd appreciate a PR.