This is the mail archive of the cygwin-patches 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: locale initialization issue


On May  4 07:04, Andy Koppe wrote:
> Hi,
> 
> I stumbled across an issues with locale initialization when the "C"
> locale is specified in the environment.
> [...]
> The attached small patch addresses this by starting with the LC_CTYPE
> locale set to "C.UTF-8"  and lc_ctype_charset set accordingly too.
> This means that setting the "C" locale is recognised as a change and
> that the conversion function pointers are updated accordingly. It also
> has the happy side effect that the setlocale call from
> initial_setlocale() will be short-circuited if the default "C.UTF-8"
> locale has not been overridden in the environment.
> 
> Additionally, I think it's time to drop the "temporarily" #if 0'd code
> for making UTF-8 the charset for the "C" locale.
> 
> It's a newlib patch, but it's entirely Cygwin-specific, so it seemed
> more appropriate to send it here.
> 
> 	* libc/locale/locale.c [__CYGWIN__]
> 	(current_categories, lc_ctype_charset): Start with the LC_CTYPE locale
> 	set to "C.UTF-8", to match initial __wctomb and __mbtowc settings.
> 	(lc_message_charset, loadlocale): Settle on ASCII as the "C" charset.

Thanks, applied with a slightly different ChangeLog entry.

Please send newlib patches to the newlib list, not to cygwin-patches.
It's the better place for bookkeeping of newlib stuff, even if it
only affects Cygwin.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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