diff --git a/filters/builtin/header_encode.go b/filters/builtin/header_encode.go index cd57f26ac1..ba6780c1b7 100644 --- a/filters/builtin/header_encode.go +++ b/filters/builtin/header_encode.go @@ -66,8 +66,63 @@ func (spec *encodeHeaderSpec) CreateFilter(args []interface{}) (filters.Filter, switch to { case "ISO8859_1": encoder = charmap.ISO8859_1.NewEncoder() + case "ISO8859_10": + encoder = charmap.ISO8859_10.NewEncoder() + case "ISO8859_13": + encoder = charmap.ISO8859_13.NewEncoder() + case "ISO8859_14": + encoder = charmap.ISO8859_14.NewEncoder() + case "ISO8859_15": + encoder = charmap.ISO8859_15.NewEncoder() + case "ISO8859_16": + encoder = charmap.ISO8859_16.NewEncoder() + case "ISO8859_2": + encoder = charmap.ISO8859_2.NewEncoder() + case "ISO8859_3": + encoder = charmap.ISO8859_3.NewEncoder() + case "ISO8859_4": + encoder = charmap.ISO8859_4.NewEncoder() + case "ISO8859_5": + encoder = charmap.ISO8859_5.NewEncoder() + case "ISO8859_6": + encoder = charmap.ISO8859_6.NewEncoder() + case "ISO8859_7": + encoder = charmap.ISO8859_7.NewEncoder() + case "ISO8859_8": + encoder = charmap.ISO8859_8.NewEncoder() + case "ISO8859_9": + encoder = charmap.ISO8859_9.NewEncoder() + case "KOI8R": + encoder = charmap.KOI8R.NewEncoder() + case "KOI8U": + encoder = charmap.KOI8U.NewEncoder() + case "Macintosh": + encoder = charmap.Macintosh.NewEncoder() + case "MacintoshCyrillic": + encoder = charmap.MacintoshCyrillic.NewEncoder() + case "Windows1250": + encoder = charmap.Windows1250.NewEncoder() + case "Windows1251": + encoder = charmap.Windows1251.NewEncoder() case "Windows1252": encoder = charmap.Windows1252.NewEncoder() + case "Windows1253": + encoder = charmap.Windows1253.NewEncoder() + case "Windows1254": + encoder = charmap.Windows1254.NewEncoder() + case "Windows1255": + encoder = charmap.Windows1255.NewEncoder() + case "Windows1256": + encoder = charmap.Windows1256.NewEncoder() + case "Windows1257": + encoder = charmap.Windows1257.NewEncoder() + case "Windows1258": + encoder = charmap.Windows1258.NewEncoder() + case "Windows874": + encoder = charmap.Windows874.NewEncoder() + default: + log.Errorf("Unknown encoder for %q", to) + return nil, filters.ErrInvalidFilterParameters } return &encodeHeader{