Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我得到了一个 XML 文件,其中充满了来自法语的 utf-8 字符串。部分消息如下:
“N'oubliez pas d'écrire le nom exact de le professeur, sans utiliser des abréviations”
正如你所看到的,口音是失败的。我尝试使用 iconv 转换文件,但似乎不被识别为 UTF-8(当文件使用该字符集时)。我能做些什么?
谢谢!
尝试在 Windows 记事本中打开该文件并查看它的外观。如果它看起来不错,那么问题可能出在其他地方(例如,您是否将数据发送到浏览器而不指定 UTF-8?)。
如果它在记事本中看起来也有问题,请尝试以下操作(我将您的数据复制到一个文件中,并且能够通过这样做“修复”它):
这个最终文件应该在记事本中正确打开,并被编码为带有三字节 UTF-8 签名的 UTF-8。