MCPcopy Index your code
hub / github.com/rclone/rclone / normalizeEncoding

Function normalizeEncoding

cmd/bisync/bisync_test.go:1954–1965  ·  view source on GitHub ↗

account for filename encoding differences between remotes by normalizing to OS encoding

(s string)

Source from the content-addressed store, hash-verified

1952
1953// account for filename encoding differences between remotes by normalizing to OS encoding
1954func normalizeEncoding(s string) string {
1955 if s == "" || s == "." {
1956 return s
1957 }
1958 nameVal, err := strconv.Unquote(s)
1959 if err != nil {
1960 nameVal = s
1961 }
1962 nameVal = filepath.Clean(nameVal)
1963 nameVal = encoder.OS.FromStandardPath(nameVal)
1964 return strconv.Quote(encoder.OS.ToStandardPath(filepath.ToSlash(nameVal)))
1965}
1966
1967func stringToHash(s string) string {
1968 ht := hash.MD5

Callers 2

mangleResultMethod · 0.85
mangleListingMethod · 0.85

Calls 2

FromStandardPathMethod · 0.65
ToStandardPathMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…