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

Luiz Americo Pereira Camara luizmed at oi.com.br
Tue Jul 21 06:45:03 CEST 2009


Hi,

I'm trying to fix bug http://bugs.freepascal.org/view.php?id=14135 but 
could not get a way to do case insensitive comparison of UTF8 strings 
with non ascii characters (in the test even ansi strings failed).

See the attached test program. I tried StrIComp, AnsiCompareText, 
CompareText and even widestringmanager.CompareTextWideStringProc.

On Linux, only AnsiCompareText worked. On Windows none worked.

Any hints on how to do such comparison or this is a limitation of  
current fpc? Or i'm doing something wrong?

BTW:

Key := 'ç';

Key will be encoded in the current system encoding Ok?

Key := Utf8Encode('ç');

'ç' will be converted to widestring and then back to Utf8 Ok?

Luiz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugCompInsensitiveUTF8.pas
Type: text/x-pascal
Size: 1510 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090721/aa213917/attachment.pas>


More information about the fpc-pascal mailing list