Hello Akira,

At 21:47 08/01/01, Tanaka Akira wrote:
>In article <6.0.0.20.2.20080101181120.082f1b30 / localhost>,
>  Martin Duerst <duerst / it.aoyama.ac.jp> writes:
>
>> But now try switching to e.g. a Turkish locale
>> (the example that follows is on a Fedora box with tcsh,
>> your mileage may vary):
>>
>> $ setenv LANG tr_TR.iso88599
>> $ ruby -e "puts 'abc'.force_encoding('US-ASCII').encoding"
>> -e:1:in `force_encoding': unknown encoding name - US-ASCII (ArgumentError)
>>         from -e:1:in `<main>'
>
>Great example.  Thank you.  I fixed.

I saw it. Very quick, great work, thank you!

>Do you know other problems?

Not for sure. With some systems, number formating is
locale-dependent (e.g. 1,000.00 -> 1.000,00 in most of
Europe), but I haven't detected such a case in Ruby yet.


>Do you have an example that locale-indepenedent function
>causes a problem?

Well, they cause problems when you want locale-dependent
behavior. For example when somebody wants to create a Ruby
program that does case-conversion in a locale-dependent way,
or that does number formatting in a locale depedent way,
and so on. Ruby currently doesn't support this. I hope
that we can add such support in the future, but it should
be done in an object-oriented way, not with a global
'setlocale' call.

For some background on what's wrong with the UNIX/POSIX
locale model, please see
http://www.w3.org/2003/Talks/0324WWL/paper.html
(but please note that that paper is more about locale information
in a WWW context than about locale in an OO programming language).

Reagards,     Martin.


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp      mailto:duerst / it.aoyama.ac.jp