Author lemburg
Recipients Arfrever, benjamin.peterson, lemburg, loewis, serhiy.storchaka
Date 2017-03-17.21:30:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The main purpose of the alias table is to support normalization and this is used for getdefaultencoding() which was created to be able to determine the default encoding based on what uses as default without doing temporary setlocale() tricks.

Now, normalization also happens when passing a locale value to the underlying setlocale(), mainly to avoid many common bugs due to setlocale() being extremely picky about the locale value. A side effect of this is that normalization will also kick in to add the encoding in case no encoding is given in the parameter.

Note that no normalization is necessary to simply set the configured default locale configured on the system. In such a case, you'd run setlocale('LC_ALL') and get what's configured.

If you run the lib C setlocale() with a locale without encoding, the encoding used by the system entirely on what's configured on the system. The SUPPORTED file only gives a hint at what glibc think it should install per default, but any admin or distributor could change these settings simply by running localedef with some other encoding (charmap in locale speak).

I suppose that we could resolve some of the confusion by adding a parameter to disable this normalization in setlocale().
Date User Action Args
2017-03-17 21:30:17lemburgsetrecipients: + lemburg, loewis, benjamin.peterson, Arfrever, serhiy.storchaka
2017-03-17 21:30:17lemburgsetmessageid: <>
2017-03-17 21:30:17lemburglinkissue20087 messages
2017-03-17 21:30:17lemburgcreate