diff options
Diffstat (limited to 'hotline/server.go')
| -rw-r--r-- | hotline/server.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hotline/server.go b/hotline/server.go index e4232b6..f4eef9b 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/go-playground/validator/v10" "go.uber.org/zap" + "golang.org/x/text/encoding/charmap" "gopkg.in/yaml.v3" "io" "io/fs" @@ -29,6 +30,12 @@ type requestCtx struct { remoteAddr string } +// Converts bytes from Mac Roman encoding to UTF-8 +var txtDecoder = charmap.Macintosh.NewDecoder() + +// Converts bytes from UTF-8 to Mac Roman encoding +var txtEncoder = charmap.Macintosh.NewEncoder() + type Server struct { NetInterface string Port int |