comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: string and wide string usage
Date: Thu, 7 Mar 2013 21:07:29 -0600
Date: 2013-03-07T21:07:29-06:00	[thread overview]
Message-ID: <khbklj$eg8$1@munin.nbi.dk> (raw)
In-Reply-To: op.wtlur3cnule2fv@cardamome

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1505 bytes --]

"Yannick Duch�ne (Hibou57)" <yannick_duchene@yahoo.fr> wrote in message 
news:op.wtlur3cnule2fv@cardamome...
>Le Fri, 08 Mar 2013 00:53:25 +0100, Randy Brukardt <randy@rrsoftware.com> 
>a �crit:
>> But I want to caution you that "converting to lower case" is not a great
>> idea if you plan to support arbitrary Unicode strings. Such conversions 
>> are
>> somewhat ambiguous, and tend to make strings appear similar that are
>> different (and sometimes the reverse happens as well).
>
>If I'm not wrong, that's the reverse, the conversion to upper-case which 
>is the one with which you may loose the more.

You're right that converting to upper case is worse, but that was my point: 
don't convert to *anything*. It doesn't matter what you convert to, you lose 
information and get the wrong answer in some cases (Turkish I's, for 
instance). Rather, leave the text in it's original case and use 
Equal_Case_Insensitive to decide whether it matches something existing. 
That's the rule for Ada identifiers (don't know if Gnat actually follows 
that, though).

Admittedly, you can't do that with some databases, so that might not be an 
option for the OP - which is a reason not to use a database unless you 
really need transactions.

                                                              Randy.
-- 
"Syntactic sugar causes cancer of the semi-colons." [1]
"Structured Programming supports the law of the excluded muddle." [1]
[1]: Epigrams on Programming - Alan J. - P. Yale University 





  reply	other threads:[~2013-03-08  3:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 11:12 string and wide string usage Ali Bendriss
2013-03-07 14:20 ` ytomino
2013-03-07 17:14   ` Dmitry A. Kazakov
2013-03-07 23:53   ` Randy Brukardt
2013-03-08  2:05     ` Yannick Duchêne (Hibou57)
2013-03-08  3:07       ` Randy Brukardt [this message]
2013-03-07 17:48 ` Vadim Godunko
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox