mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
lib/fs: Fix UnicodeLowercaseNormalized on lowercase NFD (#7692)
Co-authored-by: greatroar <@>
This commit is contained in:
parent
97437cad64
commit
0e52ce830a
@ -19,7 +19,7 @@ import (
|
|||||||
func UnicodeLowercaseNormalized(s string) string {
|
func UnicodeLowercaseNormalized(s string) string {
|
||||||
i := firstCaseChange(s)
|
i := firstCaseChange(s)
|
||||||
if i == -1 {
|
if i == -1 {
|
||||||
return s
|
return norm.NFC.String(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
var rs strings.Builder
|
var rs strings.Builder
|
||||||
|
@ -46,6 +46,7 @@ var caseCases = [][2]string{
|
|||||||
{"\u212A", "k"},
|
{"\u212A", "k"},
|
||||||
// Folding renormalizes to NFC
|
// Folding renormalizes to NFC
|
||||||
{"A\xCC\x88", "\xC3\xA4"}, // ä
|
{"A\xCC\x88", "\xC3\xA4"}, // ä
|
||||||
|
{"a\xCC\x88", "\xC3\xA4"}, // ä
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUnicodeLowercaseNormalized(t *testing.T) {
|
func TestUnicodeLowercaseNormalized(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user