Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

encodings: add . and .. to all backends, except Drive

Fabian Möllerc8d3e5741887
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)