我使用下面的代码生成字符串str的XML编码:
str := string([]byte{0x01}) marshalBytes, _ := xml.Marshal(str) fmt.Println(string(marshalBytes)) // output: <string>?</string>; ? is [239 191 189] in bytes.
显然, 不等于0x01.
我该如何解决?
xml encoding go
encoding ×1
go ×1
xml ×1