5 ms·
This works till you want at least minimal UTF-8 support, such as when you're working with actual English text as opposed to human-readable computerese.
by patrec 8y ago
This works till you want at least minimal UTF-8 support, such as when you're working with actual English text as opposed to human-readable computerese.
- kazinator 8y agoSticking to the "C" locale will work even if you want UTF-8 support. You just roll your own UTF-8 support. I built the TXR language entirely without any of the harmful garbage that is the ISO C/POSIX localization. It handles UTF-8 just fine. The C localization stuff was developed too early, at a time when nobody had any real experience with localization. Before Unicode, before the Internet. Before threads! How the do you set it up so that one thread runs in one locale and another in another? That's important if a global server is servicing two different requests simultaneously from users in two different locales. The idiotic C locale stuff relies on global variables. You set some magic variables and, poof; numerous functions in your entire image change their behavior, whether they are working with internationalized data or not. The setlocale function might as well be called fuck_my_program_please.