I'm using lstrcmpi for the task of comparing two strings without
case differences. Since this api function is not very fast, I'm
thinking about do-it-myself.

The english chars can be easy processed by masking bit 5, but
what about language-dependend special chars, like
german "umlauts" or the nordish oere char.

Another question are double byte chars like arabic ones.

Is there an all-embracing solution?
Posted on 2001-09-25 11:34:08 by beaster
The solution is lstrcmpi :grin: . I believe this API is so slow because it handles all those possibilities. You may be able to get some extra speed out of it if you code it yourself, but this sounds like a very big job.
Posted on 2001-09-26 00:51:48 by Qweerdy
beaster,

The simplest way I can think of that will remain reasonably fast is to convert the string to upper or lower case first then do the compare. Unicode is of course another problem and you would have to look at how the characters work first but its the same theory, convert both the source and second source characters to oner case then do the comparison.

Regards,

hutch@pbq.com.au
Posted on 2001-09-26 02:08:11 by hutch--
And the fastest way to upper/lowercase text, at least ansi, would
be using a table-driven approach. You'd of courese have to have
a table per language, but it can be made pretty fast.
Posted on 2001-09-26 09:19:09 by f0dder
Thank you... I'm just messing with this in a hash table DLL... This is going to be a useful tidbit.
Posted on 2001-09-26 10:09:45 by rafe