Here is the fix:
setlocale(LC_ALL, "") // this goeth to thy main()
The nature of the problem is described in the glibc manual:
A C program inherits its locale environment variables when it starts up.
This happens automatically. However, these variables do not
automatically control the locale used by the library functions, because
ISO C says that all programs start by default in the standard `C'
locale. To use the locales specified by the environment, you must call
`setlocale'. Call it as follows:
setlocale (LC_ALL, "");