lib/fs: Fix UnicodeLowercaseNormalized on lowercase NFD (#7692)

Co-authored-by: greatroar <@>
This commit is contained in:
greatroar 2021-05-17 20:43:07 +02:00 committed by GitHub
parent 97437cad64
commit 0e52ce830a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,7 @@ import (
func UnicodeLowercaseNormalized(s string) string {
i := firstCaseChange(s)
if i == -1 {
return s
return norm.NFC.String(s)
}
var rs strings.Builder

View File

@ -46,6 +46,7 @@ var caseCases = [][2]string{
{"\u212A", "k"},
// Folding renormalizes to NFC
{"A\xCC\x88", "\xC3\xA4"}, // ä
{"a\xCC\x88", "\xC3\xA4"}, // ä
}
func TestUnicodeLowercaseNormalized(t *testing.T) {