4 ms·
Thank you, you're right that's a mistake. This example was supposed to use: {sensitivity: 'base'} I've corrected it.
by davethedevguy 5y ago
Thank you, you're right that's a mistake.
This example was supposed to use:
{sensitivity: 'base'}
I've corrected it.
- mormegil 5y agoNot really. Case (in) sensitivity and accent (in)sensitivity are two orthogonal things. If you want to compare two strings, ignoring case differences, converting both to lowercase (or uppercase) is completely fine in Javascript (it might be problematic in other languages because of Turkish dotted and dotless i, but in JS, the obvious first-choice toLowerCase() is locale-ignorant, you would need to use toLocaleLowerCase() to be bitten by the problem and why would do that?). Obviously, the method considers "Á" and "a" to be different, but why wouldn't it? Those characters differ in accents, not only in case.
- davethedevguy 5y ago> Case (in) sensitivity and accent (in)sensitivity are two orthogonal things Is that definitely true? As I understand it (and I admit I'm no expert), it's common to omit accents in some languages when changing case.
- mixmastamyk 5y agoI came to write this. Why are accents being disregarded under the case-insensitive comparison section? The proper solution is typically "case fold", however I only know it from Python, not sure if Javascript supports it natively.
- davethedevguy 5y agoThanks for this. I've split 'Handling diacritics' in to a separate section to 'Case sensitivity'.