à ©和其他代码
我得到了一个充满这些代码的文件,我想将其“翻译”为普通字符(我的意思是整个文件)。我该怎么做呢?
预先非常感谢您。
I got a file full of those codes, and I want to "translate" it into normal chars (a whole file, I mean). How can I do it?
Thank you very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您最初有一个 UTF-8 文件,该文件已被解释为 8 位编码(例如 ISO-8859-15 )和实体编码。我这样说是因为序列 C3A9 看起来像是一个非常合理的 UTF-8 编码序列。
您需要首先对其进行实体解码,然后您将再次获得 UTF-8 编码。然后,您可以使用 iconv 之类的内容转换为您选择的编码。
要完成您的示例:
您提到想用 PHP 处理这个问题,这样的事情可能会为您做:
Looks like you originally had a UTF-8 file which has been interpreted as an 8 bit encoding (e.g. ISO-8859-15) and entity-encoded. I say this because the sequence C3A9 looks like a pretty plausible UTF-8 encoding sequence.
You will need to first entity-decode it, then you'll have a UTF-8 encoding again. You could then use something like iconv to convert to an encoding of your choosing.
To work through your example:
You mention wanting to handle this with PHP, something like this might do it for you: