Case insensitive search of substring in wide char

A

ajay.sonawane

How can I find the wheather the occurance substring is main string in
wide char provided that the compasion should be case insensitive.
 
M

Michael Mair

How can I find the wheather the occurance substring is main string in
wide char provided that the compasion should be case insensitive.

Assumption: Your question is "How can I find out whether a wide char
substring occurs in some wide char string under the condition that
the comparison should be case insensitive?"
Answer: "You cannot reliably."

Even if you use towupper() from <wctype.h> on every wide character
of both strings (such that they are now "upper case" strings) then
you can still have the situation that for
wint_t a, b, c, d;
there holds
(towlower(a) == towlower(b)) && (towlower(b) == c)
but
(a!=b) && (a!=c) && (b!=c)
and
d == towupper(c)
where it is open whether d compares equal to a, b or none of them.

However, if there is a one-on-one mapping of upper and lower case
letters, you can use towupper() as described above in combination
with some string search algorithm.


Cheers
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,163
Messages
2,570,897
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top