News for hackers. Stuff that matters.
Re:The complete guide to working with strings in modern Java... by mormegil on Tuesday April 13, 2021 @01:40PM (#26796087)
Not 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.
Re:The complete guide to working with strings in modern Java... by mixmastamyk on Tuesday April 13, 2021 @02:26PM (#26796799)
I 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.

Re:The complete guide to working with strings in modern Java... by davethedevguy on Tuesday April 13, 2021 @04:26PM (#26798776)
Thanks for this.

I've split 'Handling diacritics' in to a separate section to 'Case sensitivity'.

Re:The complete guide to working with strings in modern Java... by davethedevguy on Tuesday April 13, 2021 @01:44PM (#26796164)
> 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.