Skip to content

Instantly share code, notes, and snippets.

@tvi tvi/cp1250.go
Created Jul 13, 2017

Embed
What would you like to do?
golang windows cp1250 to utf8 conversion
import "golang.org/x/text/encoding/charmap"
func DecodeWindows1250(enc []byte) string {
dec := charmap.Windows1250.NewDecoder()
out, _ := dec.Bytes(ba)
return string(out)
}
func EncodeWindows1250(inp string) []byte {
enc := charmap.Windows1250.NewEncoder()
out, _ := enc.String(inp)
return out
}
@iansowinski

This comment has been minimized.

Copy link

commented Feb 5, 2018

should be:

    out, _ := dec.Bytes(enc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.