Skip to content

Instantly share code, notes, and snippets.



Created Jul 13, 2017
What would you like to do?
golang windows cp1250 to utf8 conversion
import ""
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

This comment has been minimized.

Copy link

@iansowinski iansowinski 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