From: KOSAKI Motohiro Date: 2013-05-06T06:56:09+09:00 Subject: [ruby-core:54810] Re: Call setlocale(LC_ALL, "") instead of setlocale(LC_CTYPE, "") >> I think it is acceptable that make ruby more robust. >> (i.e. fixing above failures and errors are ok.) > >> But changing setlocale invocation to LC_ALL is too dangerous. >> The change affects not only ruby itself but also other extension libraries. > > Precisely my point and precisely why setlocale should be called with > LC_ALL. It�s impossible to write extensions tat use locale-dependent > functionality unless Ruby actively supports it. Your argument held > equally true before setlocale(LC_CTYPE) was added, but still it was > added. Please elaborate more. Why don't you use strcoll_l() and/or other thread locale aware functions? http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcoll.html Why don't you use temporary locale changes such as: old_locale = setlocale(LC_COLLATE, NULL); setlocale(LC_COLLATE, your_faborite_locale); strcoll(blah blah); setlocaleLC_COLLATE, old_locale);