Case-insensitive option?
rael007 opened this issue · 4 comments
rael007 commented
Is it possible to provide case-insensitive lookup of frozen::string keys in, say, the frozen::unordered_map?
RokerHRO commented
Case-insensitive equivalence requires knowledge about the charset of the string:
- it is trivial for ASCII
- it is doable via simple lookup tables for ISO-8859-X charset family (but need different tables for each -X charset), but already introduce tricky corner cases (e.g. German ß -> SS or turkish dotless i, so case folding and case equivalence already is locale-dependent))
- it becomes very complex for Unicode (UTF-8) strings, face you with non-reflexive and non-transitive case conversions and you must handle NFC/NFD equivalence and conversions etc. – far too complex for a sinple string class. BTDT.
serge-sans-paille commented
RokerHRO commented
@rael007: Yes, I agree. Proper Unicode handling is far out of scope of both frozen::string
and std::string
. There are specialized libraries for it (e.g. libiconv), but even with these libraries the user has to know a lot about Unicode and the awkwardness of foreign scripts to use that libraries properly and correctly. It is far more complicated than English-only-speaking people might think. ;-(
serge-sans-paille commented
ok, closing the issue then.