我正在使用消息,并且消息以 byte() 格式存储,我尝试使用正确的编码将其转换为字符串,但在将其写入文件时仍会看到 unicode 字符。我在这里做错了什么
xwriter = New XmlTextWriter(filename,Encoding.UTF8)
Dim body As String = System.Text.Encoding.UTF8.GetChars(result.Body)
'body = replaceIllegalXMLChars(body) ///tried converting them explicitly but did not work
xwriter.WriteString(post)
xwriter.Flush()
样本输出:
<avataruri>http://a0.twimg.com/profile_images/1651487744/Vman_normal.jpg
</avataruri>
<suitable>0</suitable>