简体   繁体   English

如何将ISO-8859-8-i转换为UTF-8?

[英]How do I convert ISO-8859-8-i to UTF-8?

I received an email which uses the charset iso-8859-8-i . 我收到了一封使用charset iso-8859-8-i的电子邮件。 iconv says that it is an unsupported charset. iconv说这是一个不受支持的字符集。 I tried using iso-8859-8 but that gives an error with "Invalid multibyte sequence." 我尝试使用iso-8859-8但是在“无效的多字节序列”中出错。 Any idea how to convert this string to UTF-8? 知道如何将此字符串转换为UTF-8吗?

Just replace the encoding name with "iso-8859-8" . 只需用"iso-8859-8"替换编码名称即可。 The -i suffix is to indicate that it's in logical order, not the backwards "visual order" that "iso-8859-8" traditionally meant. -i后缀表示它是按逻辑顺序排列的,而不是"iso-8859-8"传统意味着的向后“视觉顺序”。 There's no way iconv can process "visual order" specially anyway, so it should convert it just fine. iconv无论如何都无法专门处理“视觉秩序”,所以它应该很好地转换它。

As for "invalid multibyte sequence", perhaps you got the source/dest charset argument order backwards? 至于“无效的多字节序列”,或许你可以向后获得source / dest charset参数顺序? If that's not the problem, then your file probably contains bytes which are not defined in the ISO-8859-8 charset, ie it's invalid... 如果那不是问题,那么你的文件可能包含未在ISO-8859-8字符集中定义的字节,即它无效...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM