通过iconv linux转换编码

taw*_*kov 4 html encoding arabic command-line-interface iconv

我以前转换编码通过iconv但今天我停止了一些新的东西,我
做了一个测试用例,让我的问题清楚:

目标是转换الحلقة الثالثة为其utf8版本:الحلقةالثالثة

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title> this text is from arabic language   </title>
</head>
<body>
<p><span> &#1575;&#1604;&#1581;&#1604;&#1602;&#1577; &#1575;&#1604;&#1579;&#1575;&#1604;&#1579;&#1577;</span></p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

试图使用编码,ASCII , LATIN1 , windows-1252但没有运气我怎么告诉这种类型的编码是什么,以便转换它?谷歌翻译+ stackoverflow编辑器都能够检测到并隐蔽它?

另一个例子:这个网站http://kanjidict.stc.cx/recode.php能够正确转换编码,如果我检查Assume HTML (default: handle as plain text)

我错过了什么和那3个网站是做它正确转换????

taw*_*kov 6

好 ,

经过一天的工作,我找到了我丢失的命令,它已经安装了一个名为的软件包 ascii2uni

简单地说: sudo apt-get install ascii2uni

经过一些测试后,我可以使用此命令将一个文件转换为unicode

ascii2uni -a D source.html > target.html

只能使用命令行转换它

干杯