X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/dd81e2cf8030aaea778677270d2a1b6ed218d6b8..2e1aec0fcfd412cff22cc4fc996973e403589ad8:/hotline/server.go 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