[Development] RFC: Defaulting to or enforcing UTF-8 locales on Unix systems
apoenitz at t-online.de
Fri Nov 1 20:29:19 CET 2019
On Fri, Nov 01, 2019 at 09:21:48AM +0000, Lars Knoll wrote:
> > There are three questions to be decided:
> > a) What should Qt 6 assume the locale to be, if no locale is set?
> > b) In case a non-UTF-8 locale is set, what should we do?
> > c) Should we propagate our decision to child processes?
> > My personal preference is:
> > a) C.UTF-8
> > b) override it to force UTF-8 on the same locale
> > c) yes
> I agree with all three choices.
a) and b) are fine with me, "c) yes" sounds like a potential problem.
Most of the child process I usually call are not Qt based, rather some random
unrelated tools, in some cases even quite old random unrelated tools.
> > ones, would not make the same choices. If we do not propagate, we could end up
> > with a child process (often helpers) that make different choices as to what
> > command-line arguments or pipes or contents in files mean.
If we propagate we'll expose the child processes to locales they might not
expect, in circumstances where the user of the system possibly intentionally
chose a non-UTF8-locale to make exactly those child processes happy.
Effectively, going for "c) yes" deprives the user of a certain level of
freedom that is needed, "c) no" is less intrusive.
"c) no" as default and a simple one-liner opt-in for applications that
want to engage in "strict parenting" might be an option, too.
More information about the Development