The following snippet converts ISO-8859-1
encoded text to UTF8
. I don't exactly understand what's going on here. Can someone explain why this works?
var utf8Buf bytes.Buffer
for _, b := range iso8859Slice {
utf8Buf.WriteRune(rune(b))
}
utf8Str := utf8Buf.String()