From 5638b4f88947254f13a34701ac5a1d6d742db128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 7 Oct 2016 15:06:02 +0200 Subject: [PATCH] Unicode gotchas --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b06936c9..6995030a0 100644 --- a/README.md +++ b/README.md @@ -3589,7 +3589,7 @@ For example, for "aimé" to match "aimé", they better have the same normalizati Besides, if you want "fi" to match the ligature "fi" (U+FB01), then you need to normalize your indexed contents and inputs to NFKC or NFKD. Use [NSString.decomposedStringWithCanonicalMapping](https://developer.apple.com/reference/foundation/nsstring/1409474-decomposedstringwithcanonicalmap) to turn a string into NFKC. -Of course, not all ligatures are decomposed by NFKC, and "Encyclopaedia" will never match "Encyclopædia", nor "Grossmann" will do "Großmann". You'll again need string processing in order to provide such matching, with tools like [CFStringFold](https://developer.apple.com/reference/corefoundation/1542031-cfstringfold), plus some extra processing of cases not handled by Unicode, and a good regression test suite. +Unicode normalization is not the end of the story, because it won't help "Encyclopaedia" match "Encyclopædia", "Mueller", "Müller", "Grossmann", "Großmann", or "Diyarbakır", "DIYARBAKIR". Happy indexing!