yandex: use lib/encoder

This commit is contained in:
Nick Craig-Wood
2019-10-05 10:22:43 +01:00
parent 7da1c84a7f
commit 5271fe3b3f
4 changed files with 41 additions and 14 deletions
+10 -1
View File
@@ -342,6 +342,14 @@ const Sharefile = encoder.MultiEncoder(
encoder.EncodeLeftPeriod |
encoder.EncodeInvalidUtf8)
// Yandex is the encoding used by the yandex backend
//
// Of the control characters \t \n \r are allowed
// it doesn't seem worth making an exception for this
const Yandex = encoder.MultiEncoder(
uint(Display) |
encoder.EncodeInvalidUtf8)
// ByName returns the encoder for a give backend name or nil
func ByName(name string) encoder.Encoder {
switch strings.ToLower(name) {
@@ -403,7 +411,8 @@ func ByName(name string) encoder.Encoder {
case "swift":
return Swift
//case "webdav":
//case "yandex":
case "yandex":
return Yandex
default:
return nil
}
+1
View File
@@ -36,6 +36,7 @@ const (
S3 = Base
Sharefile = Base
Swift = Base
Yandex = Base
)
// ByName returns the encoder for a give backend name or nil