local: refactor default os encoding out from local backend into shared encoder lib

This commit is contained in:
albertony
2021-05-28 13:34:29 +02:00
parent 63708d73be
commit 9a2811f0b2
7 changed files with 28 additions and 32 deletions

View File

@@ -3,6 +3,8 @@ package local
import (
"runtime"
"testing"
"github.com/rclone/rclone/lib/encoder"
)
// Test Windows character replacements
@@ -21,7 +23,7 @@ func TestCleanWindows(t *testing.T) {
t.Skipf("windows only")
}
for _, test := range testsWindows {
got := cleanRootPath(test[0], true, defaultEnc)
got := cleanRootPath(test[0], true, encoder.OS)
expect := test[1]
if got != expect {
t.Fatalf("got %q, expected %q", got, expect)