don't use setlocale(3); it is not thread-safe.