case conversion with Turkish locale

ismail dönmez ismail.donmez@gmail.com
Sat Oct 23 09:48:00 GMT 2004


Hi Ulrich,


On Sat, 23 Oct 2004 01:53:30 -0700, Ulrich Drepper <drepper@redhat.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> ismail dönmez wrote:
> > Well imho there should a locale safe version of conversions functions
> > so that I dont have to do export LC_ALL=POSIX before running programs
> > that choke on Turkish locales.
> 
> What "conversions functions"?
> 
> If you mean tolower or strcasecmp, just use
> 
>   locale_t c_loc = newlocale (LC_ALL_MASK, "C", NULL);
> 
>   lower = tolower_l (upper, c_loc);
> 
> and similar code for other functions.  You have to call newlocale() only
> once in the entire program run.

I was using setenv workarounds.... Thanks for info.

> 
> But this cannot solve the fundamental problem that the often made
> assumption, that the value of tolower/toupper of a byte is another byte,
> is wrong in some locales.  This can only be solved by rewriting code.
> And the fact seems to be that those affected by the problems have to
> come up with (clean) patches to fix them.
> 

If you tell me what functions/files needs rewriting/fixing I will be
happy to have a look as these problems ruin my Linux usage.

Regards,
ismail

-- 
Time is what you make of it



More information about the Libc-alpha mailing list