Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-12

_wcsicmp

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to Adriaan van Os
Adriaan van Os wrote
Is there an RTL or package equivalent for _wcsicmp et all <http://msdn.microsoft.com/en-us/library/k59z8dwe.aspx > or should the libc declaration be added to the application ? Or is there another recommendation to compare wide (so-called Unicode) strings case-insensitive ?

The closest equivalent is probably sysutils.UnicodeCompareText(). It uses CompareStringW on Windows though, and on Unix it converts both strings to uppercase, locale-sensitive-wise, and compares those.

Jonas

Reply by email

Chris Dryburgh
to Jonas Maebe
Jonas Maebe wrote 5 lines
The closest equivalent is probably sysutils.UnicodeCompareText(). It uses CompareStringW on Windows though, and on Unix it converts both strings to uppercase, locale-sensitive-wise, and compares those.

As a general rule it is better to convert to lower case before comparing Unicode characters. Accents can get lost in conversion to uppercase. Accent loss does not happen or is much more rare in conversion to lower case.

Reply by email