[fpc-pascal] Case insensitive comparison of strings with non-ascii characters

JoshyFun joshyfun at gmail.com
Sat Jul 25 21:06:17 CEST 2009


Hello FPC-Pascal,

Thursday, July 23, 2009, 2:02:38 PM, you wrote:

LAPC> Hi, i'm aware that the performance is bad although had not tested like
LAPC> you did, but at this point i'd like to stick with a solution that fpc
LAPC> provides natively since it's being used in a fpc component 
LAPC> (TSqlite3Dataset).

Write unicode functions in UTF8 is almost non-sense, most unicode
operations are not like we are used in the ANSI world, in unicode also
there are a language context as in example in spanish 'á' renders to
uppercase 'Á' but in other languages they are different letters.

There are some functions named "general case" which perform a
reasonable job for most used languages and only introduce errors in
non widespread ones.

I have some implementations for the general case, not heavily tested,
like sametext, upper, lower and a bit more.

The code is not optimized but if somebody wants to use them please ask
:)

The case of the SameText is specially CPU consumer as each string must
be transformed several times before the comparation is some complex
characters are present.

-- 
Best regards,
 JoshyFun




More information about the fpc-pascal mailing list