[Development] RFC: Defaulting to or enforcing UTF-8 locales on Unix systems

Simon Hausmann Simon.Hausmann at qt.io
Tue Apr 28 17:55:04 CEST 2020


Hi,

AFAICS (from the public coin logs that dump the entire set of environment variables), nothing specifically sets any of the locale environment variables. In fact, no variables are set. You can check for yourself for example from the macOS log from one of the recent qtbase dev integrations:

    https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1588073951



The regular Apple Terminal appears to be the entity that sets LC_CTYPE before launching the shell - however the CI system is not using the Apple Terminal.

I see two options:

    (1) Either assume that macOS is UTF-8.

    (2) We add a script to the provisioning of macOS to always set the LC_CTYPE environment variable to have the value UTF-8 (or any other environment variable that you'd like).


Can you think of any other ways to resolve this?

Simon
________________________________
From: Development <development-bounces at qt-project.org> on behalf of Thiago Macieira <thiago.macieira at intel.com>
Sent: Tuesday, April 28, 2020 17:42
To: development at qt-project.org <development at qt-project.org>
Subject: Re: [Development] RFC: Defaulting to or enforcing UTF-8 locales on Unix systems

On Tuesday, 28 April 2020 07:20:33 PDT Thiago Macieira wrote:
> On Monday, 27 April 2020 13:54:13 PDT Simon Hausmann wrote:
> > I looked at the patch again and searched a bit around. I think nl_langinfo
> > is “broken” on macOS but it doesn’t matter: everything seems to be utf-8,
> > all system APIs expect it. I think the CI is well configured and the patch
> > should treat Darwin like Android
>
> nl_langinfo is not broken on Mac. I tested it on 10.14 and 10.15 and it
> works just fine. More importantly, setlocale() obeys the LC_ALL behaviour
> to change the locale of the POSIX functions just fine.
>
> What I need is that the CI set LANG or LC_ALL to "UTF-8". Somehow, the CI
> either unset that or was run from an environment that didn t have it set in
> he first place.

Another possibility is that some script overrode LC_ALL to "C" so as to get
non-localised output. Please fix it to override to "C.UTF-8" or something that
works on a Mac.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



_______________________________________________
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200428/c57228de/attachment-0001.html>


More information about the Development mailing list