fix: fixup adresse correction
This commit is contained in:
@@ -6,6 +6,11 @@ import (
|
||||
"math/big"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"golang.org/x/text/runes"
|
||||
"golang.org/x/text/transform"
|
||||
"golang.org/x/text/unicode/norm"
|
||||
)
|
||||
|
||||
func GenerateUniqueFileName(productName string, originalFileName string) string {
|
||||
@@ -30,3 +35,11 @@ func SanitizeFilePath(path string) (string, error) {
|
||||
|
||||
return cleaned, nil
|
||||
}
|
||||
|
||||
// NormalizeAddress supprime les accents et normalise les espaces, pour
|
||||
// comparer deux adresses saisies différemment (casse/accents/espaces).
|
||||
func NormalizeAddress(s string) string {
|
||||
t := transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)
|
||||
result, _, _ := transform.String(t, s)
|
||||
return strings.Join(strings.Fields(result), " ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user