Thorsten Glaser wrote: > >Do you also "canonicalize" en_US.ISO8859-1 to en_US.UTF-8? This would be > >an even bigger bug, because the UTF-8 encoding is not the same nor an > >extension > >of the requested ISO-8859-1 encoding. > > In MirBSD, there is exactly one encoding, called “OPTU-8” internally, > which looks like UTF-8
So, when the caller specifies an encoding such as ISO8859-1 in the argument, your setlocale() implementation ought to return NULL and have no side-effects. The current behaviour of setting the locale to "C" in that case is just broken. The spec of setlocale() is not that long to read: <http://www.opengroup.org/onlinepubs/9699919799/functions/setlocale.html> Bruno