This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: suggestion (was Re: 1.7.7: Localization does not follow the language of the OS)


> The official way to set the locale is to use the locale(1) tool, see the
> User's Guide http://cygwin.com/cygwin-ug-net/using-utils.html#locale
>
>   export LANG=`locale -u`       setenv LANG `locale -u`
>   export LANG=`locale -s`       setenv LANG `locale -s`
>
> or better
>
>   export LANG=`locale -uU`      setenv LANG `locale -uU`
>   export LANG=`locale -sU       setenv LANG `locale -sU`

Thanks for this suggestion. I tested the locale command, and it does
what you describe.

Unfortunately, the people who download my application usually don't have
Cygwin, so I'll have to distribute locale.exe with my application. Also,
this trick will add extra complexity to my software, which is (AFAIK) not
necessary on other UNIX platforms.

Despite these disadvantages, I think this is a useful solution for me.
locale.exe is only 18kB; I'll just check the license again to see if this
distributing is OK.

About the quotation method discussion: I think this is irrelevant for me,
as I am planning to call locale directly from the C++ code, to retrieve
the system locale, and then, again from C++, set the LANG variable, before
initializing the localization.

> This has been discussed a couple of months ago and the decision was to
> set the lang to C.UTF-8 by default on all systems and everything else is
> up to the user.  I'm too lazy to search but you'll find lengthy
> discussions in the archives.

I'd like to see this discussion. I have been looking for something like
this in the mailing list, but I couldn't find it. Do you have suggestions
for search keywords? I understand if you don't want to reopen old
discussions, but I am curious what sort of advantages are achieved by
always setting LANG to C.UTF-8.




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]