[Exercise: Put an invalid UTF-8 byte sequence into the string. (How?) What happens to the iterations of the loop?]
我所做的是
const nihongo = "\xbd日本語\xbd"
for index, runeValue := range nihongo {
fmt.Printf("%x, %d\n", runeValue, index)
}
输出是
fffd, 0
65e5, 1
672c, 4
8a9e, 7
fffd, 10
我的问题是。utf-8编码的字节如何bd格式化为单位代码点u+fffd?
小唯快跑啊
相关分类