From: Nikolai Weibull Date: 2013-05-06T16:49:48+09:00 Subject: [ruby-core:54818] Re: Call setlocale(LC_ALL, "") instead of setlocale(LC_CTYPE, "") On Sun, May 5, 2013 at 11:56 PM, KOSAKI Motohiro wrote: >> 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()[?] I do, but it might not be available. > 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); Because it���s not thread safe.