mirror of
https://github.com/rclone/rclone.git
synced 2025-08-13 23:38:51 +02:00
lib/encoder: add CrLf encoding
This commit is contained in:
@ -43,6 +43,7 @@ var maskBits = []struct {
|
||||
{encoder.EncodeWin, "EncodeWin"},
|
||||
{encoder.EncodeSlash, "EncodeSlash"},
|
||||
{encoder.EncodeBackSlash, "EncodeBackSlash"},
|
||||
{encoder.EncodeCrLf, "EncodeCrLf"},
|
||||
{encoder.EncodeHashPercent, "EncodeHashPercent"},
|
||||
{encoder.EncodeDel, "EncodeDel"},
|
||||
{encoder.EncodeCtl, "EncodeCtl"},
|
||||
@ -99,6 +100,11 @@ var allMappings = []mapping{{
|
||||
}, []rune{
|
||||
'\',
|
||||
}}, {
|
||||
encoder.EncodeCrLf, []rune{
|
||||
rune(0x0D), rune(0x0A),
|
||||
}, []rune{
|
||||
'␍', '␊',
|
||||
}}, {
|
||||
encoder.EncodeHashPercent, []rune{
|
||||
'#', '%',
|
||||
}, []rune{
|
||||
@ -354,7 +360,7 @@ func fatalW(_ int, err error) func(...interface{}) {
|
||||
}
|
||||
|
||||
func invalidMask(mask uint) bool {
|
||||
return mask&encoder.EncodeCtl != 0 && mask&(encoder.EncodeLeftCrLfHtVt|encoder.EncodeRightCrLfHtVt) != 0
|
||||
return mask&(encoder.EncodeCtl|encoder.EncodeCrLf) != 0 && mask&(encoder.EncodeLeftCrLfHtVt|encoder.EncodeRightCrLfHtVt) != 0
|
||||
}
|
||||
|
||||
// construct a slice containing the runes between (l)ow (inclusive) and (h)igh (inclusive)
|
||||
|
Reference in New Issue
Block a user