1

Specifically, is UTF-8 supported on all platforms and can I just use std::setlocale(LC_CTYPE, ".UTF-8")?

It looks like Windows supports this, but I have no experience with it on Windows. Stuff like "en_GB.UTF-8" is the default on most GNU/Linux operating systems, so I'll assume that this works on all the platforms that may ever be relevant (embedded solutions and esoteric variants of 1956 Debian distrubtions are not relevant). Likewise on macOS the locale defaults (at least) to a string similar to the Linux locale.

Not supporting other platforms is acceptable, but I'd rather be able to support Haiku or some other minor operating system than not.

I'll probably end up using different locales, for example "da_DK.UTF-8", instead of plain ".UTF-8", if that's required, based on a platform specific configuration file, but I'd rather not have the language or culture defined as part of the locale, since the program I'm working on is doing pretty heavy text manipulation/comparison on text spanning many cultures and languages -- some times comparing strings in several different languages and scripts.

Specifically, this is relevant for upper/lower case comparisons.

Clearer
  • 2,038
  • 23
  • 36
  • 1
    No, Windows does not support UTF-8 locales, there is no way to set it. You should either use external library or use provided wide api. See https://stackoverflow.com/questions/4324542/what-is-the-windows-equivalent-for-en-us-utf-8-locale – StaceyGirl Dec 19 '17 at 10:32

0 Answers0