Unicode 同样是转化为16进制,有什么区别?
signStr := fmt.Sprintf("%x", j)
fmt.Println(signStr) //是unicode
fmt.Println(hex.EncodeToString([]byte(str)))
A := string(rstr)
fmt.Println(A) //不是Unicode,但是
- 不能转换英文、数字和特殊字符
sText := "王通"
textQuoted := strconv.QuoteToASCII(sText)
//textQuoted := strconv.Quote(sText)
textUnquoted := textQuoted[1 : len(textQuoted)-1]
fmt.Println(textUnquoted)
sUnicodev := strings.Split(textUnquoted, "\\u")