3 ms·
At least it should perform validation and reject the NFD form and force the client to normalize to NFC?
by silon42 5y ago
At least it should perform validation and reject the NFD form and force the client to normalize to NFC?
- rurban 5y agoNFD is fine when you dont have much time and can afford the space. NFC is about 3x slower and smaller. Forcing clients never works. Be tolerant what you accept and strict what you write. In the case of C++23 enforcing NFC my mind is twisted. It would allow heavy tokenizer optimizations, but this is an offline compiler, where you don't really need that. The problem are the compatible variants, NFKC and NFKD. But then you have usecases where you need them, and more to actually find strings. Levenshtein should not be the default when searching for strings.