bug-glibc
[Top][All Lists]
Advanced

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

Re: case sensitive string functions and l10n


From: Andreas Schwab
Subject: Re: case sensitive string functions and l10n
Date: Mon, 01 Sep 2003 17:27:50 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

Bjoern JACKE <address@hidden> writes:

> Hi,
> localization brings a lot of trouble with string functions which do *very*
> different things in different locales:
>
> export LC_ALL=tr_TR
> echo I | tr [:upper:] [:lower]
> ... results in a dotless i.
>
> export LC_ALL=tr_TR.UTF-8
> echo I | tr [:upper:] [:lower]
> ... results in the "normal" i.
>
> This is a strange inconsitency anyway.

The upper->lower conversion is ambigous, so you can't expect to get
consistency.

> But I would say it is not sane at all if major functions like tolower()
> and toupper() are being localozed and are no longer ASCII compatible.
>
> This caused a lot of troube for mutt 2 years ago, where we had to
> introduce ascii versions of case sensitive functions, becuase "ASCII" or
> "ISO" was no longer the same as "ascii" or "iso". CUPS had the same
> problem still a few weeks ago and now I see, lynx has the same "turkish"
> problem (imagine to write html tags with non-ascii characters and expect
> this to work), where this functions everyone uses everyday suddenly are no
> longer ascii compatible.

The ctype functions are not designed for use with identifiers in
programming languages.  If you want to convert ABCDEFGHIJKLMNOPQRSTUVWXYZ
to abcdefghijklmnopqrstuvwxyz use that and not [:upper:] and [:lower:].

> Wouldn't it be better to introduce localized versions of this functions
> and giver them a different name?

This wouldn't be C any more.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Attachment: pgpR24bWybo4c.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]