MCPcopy
hub / github.com/autobrr/qui / NormalizeUnicode

Function NormalizeUnicode

pkg/stringutils/unicode.go:125–127  ·  view source on GitHub ↗

NormalizeUnicode removes diacritics and decomposes ligatures with caching. Results are cached per input string (5 minute TTL) to avoid repeated expensive transformations. For the full normalization with additional punctuation handling, use NormalizeForMatching instead. Examples: - "Shōgun" → "Shogun

(s string)

Source from the content-addressed store, hash-verified

123// - "æ" → "ae"
124// - "fi" → "fi"
125func NormalizeUnicode(s string) string {
126 return unicodeNormalizer.Normalize(s)
127}
128
129// NormalizeForMatching applies cached full normalization for cross-seed matching:
130// - Unicode normalization (removes diacritics, decomposes ligatures)

Callers 2

normalizeFileKeyFunction · 0.92
TestNormalizeUnicodeFunction · 0.85

Calls 1

NormalizeMethod · 0.45

Tested by 1

TestNormalizeUnicodeFunction · 0.68