When searching the text Çınaraltı Café
for the text Ci
using the code
NSStringCompareOptions options =
NSCaseInsensitiveSearch |
NSDiacriticInsensitiveSearch |
NSWidthInsensitiveSearch;
NSLocale *locale = [NSLocale localeWithLocaleIdentifier:@"tr"];
NSRange range = [haystack rangeOfString:needle
options:options
range:NSMakeRange(o, haystack.length)
locale:locale];
I get range.location
equals NSNotFound
.
It's not to do with the diacritic on the initial Ç because I get the same result searching for alti
where the only odd character is the ı. I also get a valid match searching for Cafe
which contains a diacritic (the é).
The apple docs mention this situation as notes on the locale
parameter and I think I'm following them. Though I guess I'm not because it's not working.
How can I get a search for 'i' to match both 'i' and 'ı'?