From: Michal Suchanek Date: 2008-01-14T21:32:09+09:00 Subject: Re: does ruby's strftime not attempt POSIX-compliance? On 14/01/2008, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: does ruby's strftime not attempt POSIX-compliance?" > on Sun, 13 Jan 2008 07:57:58 +0900, Suraj Kurapati writes: > > |Hmm, I thought Matz said that Ruby 1.9 does this: > | > | setlocale( ENV['LC_TYPE'] ) > | > |instead of this: > | > | setlocale( 'C' ) > | > |Matz, would you please clarify? > > Yes, the Ruby interpreter calls > > setlocale(LC_CTYPE, ""); > > just because full setlocale (especially LC_TIME and LC_NUMERIC) can > cause problems if called implicitly. > Could you be more specific about the problems you envision? If there would be problems in the ruby core functionality it is perhaps the right time to check for them now by setting LC_ALL from the environment and waiting for bug reports. This is a development release after all. That way people could embed ruby 1.9 in applications that use locale. I would expect that ruby core classes would behave exactly the same regardless of locale. A special library might provide get/setlocale and some locale-dependent formatting functions just like there is win32api for windows. Programs called from ruby could give different output in different locale (eg `date`) but that does not depend on the way ruby sets up locale for itself, they read the environment variables anyway. Thanks Michal