mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 00:43:49 +01:00
local: encode invalid UTF-8 on macOS
This commit is contained in:
parent
32af4cd6f3
commit
6ae7bd7914
9
backend/local/encode_darwin.go
Normal file
9
backend/local/encode_darwin.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//+build darwin
|
||||||
|
|
||||||
|
package local
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/rclone/rclone/fs/encodings"
|
||||||
|
)
|
||||||
|
|
||||||
|
const enc = encodings.LocalMacOS
|
@ -1,4 +1,4 @@
|
|||||||
//+build !windows
|
//+build !windows,!darwin
|
||||||
|
|
||||||
package local
|
package local
|
||||||
|
|
||||||
|
@ -21,6 +21,13 @@ const Display = encoder.Standard
|
|||||||
// LocalUnix is the encoding used by the local backend for non windows platforms
|
// LocalUnix is the encoding used by the local backend for non windows platforms
|
||||||
const LocalUnix = Base
|
const LocalUnix = Base
|
||||||
|
|
||||||
|
// LocalMacOS is the encoding used by the local backend for macOS
|
||||||
|
//
|
||||||
|
// macOS can't store invalid UTF-8, it converts them into %XX encoding
|
||||||
|
const LocalMacOS = encoder.MultiEncoder(
|
||||||
|
uint(Base) |
|
||||||
|
encoder.EncodeInvalidUtf8)
|
||||||
|
|
||||||
// LocalWindows is the encoding used by the local backend for windows platforms
|
// LocalWindows is the encoding used by the local backend for windows platforms
|
||||||
//
|
//
|
||||||
// List of replaced characters:
|
// List of replaced characters:
|
||||||
@ -267,6 +274,8 @@ func ByName(name string) encoder.Encoder {
|
|||||||
return LocalWindows
|
return LocalWindows
|
||||||
case "local-unix", "unix":
|
case "local-unix", "unix":
|
||||||
return LocalUnix
|
return LocalUnix
|
||||||
|
case "local-macos", "macos":
|
||||||
|
return LocalMacOS
|
||||||
case "mega":
|
case "mega":
|
||||||
return Mega
|
return Mega
|
||||||
case "onedrive":
|
case "onedrive":
|
||||||
@ -309,6 +318,7 @@ func Names() []string {
|
|||||||
"koofr",
|
"koofr",
|
||||||
"local-unix",
|
"local-unix",
|
||||||
"local-windows",
|
"local-windows",
|
||||||
|
"local-macos",
|
||||||
"local",
|
"local",
|
||||||
"mega",
|
"mega",
|
||||||
"onedrive",
|
"onedrive",
|
||||||
|
Loading…
Reference in New Issue
Block a user