It could be a silly question but when I try to append a []byte slice to a [][]byte
slice I get weird results.
Here is my code:
func Normalizer(s string) (ss [][]byte) {
ss = make([][]byte, 0)
// norm
var ia norm.Iter
ia.InitString(norm.NFC, s)
for !ia.Done() {
next := ia.Next()
fmt.Println(next)
// [226 128 139]
// [227 128 129]
// [39]
// [226 128 153]
// [46]
// [44]
// [63]
// [33]
// [92]
// [10]
// [226 128 153]
// ...
ss = append(ss, next)
}
ia.Done()
fmt.Println(ss)
return
}
I'm expecting somethin like this:
// [[226 128 139] [227 128 129] [39] [226 128 153] [46] [44] [63] [33] [92] [10] [226 128 153]...]
but instead i get this:
// [[226 129 128] [226 129 128] [226] [226 129 128] [226] [226] [226] [226] [226] [226] [226 129 128]...]
and I have no idea why. Help and explanation would be appreciated.