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

This commit is contained in:
Fabian Möller 2019-04-30 13:01:19 +02:00 committed by Nick Craig-Wood
parent d5cd026547
commit c8d3e57418
2 changed files with 11 additions and 2 deletions

View file

@ -189,6 +189,14 @@ which will be specified in the documentation for each backend.
| / | 0x2F | | | / | 0x2F | |
| DEL | 0x7F | ␡ | | 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} #### Invalid UTF-8 bytes {#invalid-utf8}
Some backends only support a sequence of well formed UTF-8 bytes Some backends only support a sequence of well formed UTF-8 bytes

View file

@ -12,7 +12,8 @@ import (
// Base only encodes the zero byte and slash // Base only encodes the zero byte and slash
const Base = encoder.MultiEncoder( const Base = encoder.MultiEncoder(
encoder.EncodeZero | encoder.EncodeZero |
encoder.EncodeSlash) encoder.EncodeSlash |
encoder.EncodeDot)
// Display is the internal encoding for logging and output // Display is the internal encoding for logging and output
const Display = encoder.Standard const Display = encoder.Standard
@ -83,7 +84,7 @@ const Box = encoder.MultiEncoder(
// Drive is the encoding used by the drive backend // 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. // Don't encode / as it's a valid name character in drive.
const Drive = encoder.MultiEncoder( const Drive = encoder.MultiEncoder(
encoder.EncodeInvalidUtf8) encoder.EncodeInvalidUtf8)