【发布时间】:2015-09-19 20:41:59
【问题描述】:
当我在 0x80 或以上的位置向字符串添加单个字节时,golang 将在我的字节前添加 0xc2。 我认为这与utf8 runes 有关。无论哪种方式,我如何将 0x80 添加到字符串的末尾?
例子:
var s string = ""
len(s) // this will be 0
s += string(0x80)
len(s) // this will be 2, string is now bytes 0xc2 0x80
【问题讨论】: