[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Maybe we don't have a name controversy after all



: I believe this misunderstanding comes from a long standing mis-concept that
: "setlocale" returns the "official" locale name. It is wrong, period. It's time
: to stop this practice. Don't you agree?

I agree. But I have another question and hope to hear your opinion.
If a program needs to take the currect locale name for specific reactions
(for example, read different configuration file), then the so-called
"official locale name" becomes important. Even it use "setlocale()" to
get the locale name and use "nl_langinfo()" to get the encoding name,
however the combination of them will not always result to the same string.
For example, in current glibc-2.2 we will get "zh_TW" + "big5", but in
other platform it might be "zh_TW.big5" + "big5" or other kinds. So, how
to write a "portable" program to overcome this situation?

: As for choosing short name "zh_TW" over "zh_TW.big5", I'm not exactly sure
: why this is done. To my taste "zh_TW.big5" would be fine. I agree that
: "zh_TW" traditionally has been associated with EUC-TW encoding, although
: no standard has required that. It seems that now people (outside Taiwan) think
: it's time to change (both glibc and xfree are doing this). If you guys do not
: agree, tell them to stop. However, in terms of being different from
: "zh_TW.Big5", "zh_TW.big5" is no better than "zh_TW". Programs like "xcin"  
: will still be broken if it continue to rely on the return value of "setlocale".

Of course we will modify xcin source to not rely on the return value of
"setlocale". If fact I already have a patch which could let xcin run in
every kinds of locale name. But I don't know if my patch is a standard
programming style. I am afraid to introduce new bugs (just like the bug
of rely on the return value of setlocale()). So I have the above question.

: To summarize my points, the accusation that glibc forces us to use "zh_TW"
: (or "zh_TW.big5") as TW's official locale name is flatly untrue. Indeed,   
: glibc is trying to do the opposite, accepting as many as possible names,
: thus making everyone happy no matter what they insist to use for locale names.
: The internal name used by glibc should not be a concern of users. You could  
: and should continue to use whatever name you used before. The whole panic 
: started because some people believe that "setlocale" should return so called
: "official" locale name and should be "zh_TW.Big5". By now I think everyone
: should realize that this is wrong. Especially, charset name should come from
: somewhere else. So the whole thing was unsound. Let's stop the panic and stop 
: the spreading of the panic right now!  
: 
: Thank you for bearing with me. I hope this clarify things enough so we can
: put this behind us.

Thank you very much of your explanation, which is really valuable. And I 
should apologize that I bother you and other friends with such a issue.
I will take your opinions into consideration when develping new programs.

Thanks. :-))

T.H.Hsieh

-- 
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.



Reply to: