C++ Logo

SG16

Advanced search

Subject: Re: Locales, Encodings and Unicode
From: Lyberta (lyberta_at_[hidden])
Date: 2020-01-25 07:22:00


Corentin Jabot via SG16:
> If the conclusion of that that the only workable solution is to require
> utf8 in future localization facilities?
> Maybe.
> But it puts requirements on the environment - "Just use utf-8" is not
> currently workable on windows 7 / zOs, etc
> (On windows 10 we can actually force the program's environment to use utf8
> - which is a good solution for new programs)

Let's separate localization from interacting with outside system. C++
standard library should be Unicode unless interacting with the other
world but that should be a separate "module". If outside world is not
UTF-whatever, C++ standard library can try to transcode and throw
exception in case that some Unicode scalar values can't be transcoded.

Of course, in many cases you just have to rely on OS and user
application being sane such as using UTF-8. And if they're not, you get
mojibake but that would almost always be the fault of the user of the
program.




SG16 list run by sg16-owner@lists.isocpp.org