mirror of
https://github.com/rclone/rclone.git
synced 2026-01-03 17:13:18 +00:00
encoder/filename: Add SCSU as tables
Instead of only adding SCSU, add it as an existing table. Allow direct SCSU and add a, perhaps, reasonable table as well. Add byte interfaces that doesn't base64 encode the URL as well with `EncodeBytes` and `DecodeBytes`. Fuzz tested and decode tests added.
This commit is contained in:
committed by
Nick Craig-Wood
parent
47b69d6300
commit
424aaac2e1
@@ -25,7 +25,9 @@ func Fuzz(data []byte) int {
|
||||
panic(fmt.Sprintf("error decoding %q, input %q: %v", enc, string(data), err))
|
||||
}
|
||||
if !bytes.Equal(data, []byte(decoded)) {
|
||||
panic(fmt.Sprintf("decode mismatch, encoded: %q, org: %q, got: %q", enc, string(data), decoded))
|
||||
table := decodeMap[enc[0]]
|
||||
table--
|
||||
panic(fmt.Sprintf("decode mismatch, encoded: %q, org: %q, got: %q, table %d", enc, string(data), decoded, int(table)))
|
||||
}
|
||||
|
||||
// Everything is good.
|
||||
|
||||
Reference in New Issue
Block a user