From c8d3e5741887090de06c70721f0cc7095bac4c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=B6ller?= Date: Tue, 30 Apr 2019 13:01:19 +0200 Subject: [PATCH] encodings: add . and .. to all backends, except Drive --- docs/content/overview.md | 8 ++++++++ fs/encodings/encodings.go | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/content/overview.md b/docs/content/overview.md index b98a4abe4..cc58751d9 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -189,6 +189,14 @@ which will be specified in the documentation for each backend. | / | 0x2F | / | | DEL | 0x7F | ␡ | +The default encoding will also encode these file names as they are +problematic with many cloud storage systems. + +| File name | Replacement | +| --------- |:-----------:| +| . | . | +| .. | .. | + #### Invalid UTF-8 bytes {#invalid-utf8} Some backends only support a sequence of well formed UTF-8 bytes diff --git a/fs/encodings/encodings.go b/fs/encodings/encodings.go index f230c285b..2432c2c1f 100644 --- a/fs/encodings/encodings.go +++ b/fs/encodings/encodings.go @@ -12,7 +12,8 @@ import ( // Base only encodes the zero byte and slash const Base = encoder.MultiEncoder( encoder.EncodeZero | - encoder.EncodeSlash) + encoder.EncodeSlash | + encoder.EncodeDot) // Display is the internal encoding for logging and output const Display = encoder.Standard @@ -83,7 +84,7 @@ const Box = encoder.MultiEncoder( // Drive is the encoding used by the drive backend // -// Encode invalid UTF-8 bytes as json doesn't handle them. +// Encode invalid UTF-8 bytes as json doesn't handle them properly. // Don't encode / as it's a valid name character in drive. const Drive = encoder.MultiEncoder( encoder.EncodeInvalidUtf8)