This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: case conversion with Turkish locale


-----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.


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.

- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBehwK2ijCOnn/RHQRArsKAJ9hBnkPM74S8tH+KmCrvISfrN8ZwwCghFW7
3c+u8PlnuuwLb9UBZoNROrU=
=6bNL
-----END PGP SIGNATURE-----


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