On 30 March 2015 at 20:33, FRIGN <d...@frign.de> wrote: > On Mon, 30 Mar 2015 19:05:19 +0200 > Markus Wichmann <nullp...@gmx.net> wrote: > >> How about simply calling setlocale()? Or was that too simple? If the >> user has set a non-UTF-8 locale and then uses UTF-8, that's on them! > > POSIX locales are an insane concept. Unicode has already gone a long > way to define sane international collation and sorting sequences which > make sense. The idea of localized differences has its origin in the > sick minds of the POSIX-authors. > > sbase and ubase are one part of a protest against all this locale- > madness. I agree there should be localized date-formats, but everything > beyond that is mostly insane. > We assume a UTF-8-locale and that's it. setlocale is just ugly and imho > not the solution to this issue.
Amen. How about a POSICK_INC and POSICK; macros that you put into config.mk for those buildings with glibc. By default it'll be just undefined. In case of glibc you comment in config.mk: # uncomment for glibc usage #CLFAGS_POSICK = -DPOSICK_INC='#include <locale.h>' -DPOSICK='setlocale(LC_ALL, "en_UK.UTF_8")' ... CLFAGS = ... ${CFLAGS_POSICK} Best regards, Anselm