> On 25 Jun 2020, at 15:19, Ingo Schwarze <schwa...@usta.de> wrote: > > Hans Aberg wrote on Thu, Jun 25, 2020 at 10:15:03AM +0200: > >> MacOS sets as default LC_CTYPE=UTF-8, not appearing in the 'locale >> -a' list. Then some software interprets this as though the locale >> is C/POSIX, disregards the UTF-8 encoding, and converts all non-ASCII >> (high bit set) char's into octal escape sequences. What is the >> correct interpretation here? > > The correct interpretation of "LC_CTYPE=UTF-8" is whatever the > documentation of the respective operating system says. > All POSIX says is: > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/setlocale.html > > The locale argument is a pointer to a character string containing > the required setting of category. The contents of this string are > implementation-defined. > > POSIX only specifies the meaning of the strings "C" and "POSIX"; > any others are implementation-defined.
This is also what I thought. As for the other your comments, rather than checking for a particular syntax, it seems that the particular software checks the 'locale -a' list, and if it is not there, applies the C/POSIX locale. Perhaps there should be a default UTF-8 locale: It seems that the current construct does not apply so well to it.