From 0e52ce830adb0d3a5eb3abfa902f399b6d8bf28a Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Mon, 17 May 2021 20:43:07 +0200 Subject: [PATCH] lib/fs: Fix UnicodeLowercaseNormalized on lowercase NFD (#7692) Co-authored-by: greatroar <@> --- lib/fs/folding.go | 2 +- lib/fs/folding_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fs/folding.go b/lib/fs/folding.go index 5ba6d4530..20887b95e 100644 --- a/lib/fs/folding.go +++ b/lib/fs/folding.go @@ -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 diff --git a/lib/fs/folding_test.go b/lib/fs/folding_test.go index f19cfb4f1..c3e05fa8b 100644 --- a/lib/fs/folding_test.go +++ b/lib/fs/folding_test.go @@ -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) {