Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ncoding/charmap

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs committed Sep 18, 2024
1 parent 47bb9f9 commit e88489e
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions filters/builtin/header_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit e88489e

Please sign in to comment.