HTML Tidy 处理后的希伯来字符变成了乱码
我正在使用 HTML Tidy Online (http://infohound.net/tidy/) 来整理一些非常旧且混乱的 HTML 文件,其中包含一些希伯来语字符。每当 Tidy 处理页面时,即使在更改设置中的编码方法之后,输出也会将希伯来字符变成乱码。使用不同的设置,我确实设法获得与 Unicode 实体相同的希伯来字符输出。 我用谷歌搜索了可能的解决方案,但没有找到。 我心里有几个想法,但我不确定如何实现它们(如果有的话)(也许有人有更好的解决方案)。
- 我想也许我可以(在处理页面之后)扫描页面中的 unicode 实体,并将它们替换为相应的希伯来字符(当然,以系统的方式)。
- 也许我可以获取 HTML Tidy 源代码并修改它以适当地输出希伯来字符。问题是我怀疑我是否有足够的知识来开始做这样的事情。
I'm using HTML Tidy Online (http://infohound.net/tidy/) to tidy up some very old and messed up HTML file which contains some Hebrew characters. Whenever the page is processed by Tidy the output turns Hebrew characters into gibberish, even after changing encoding methods in the settings. Using different settings, I do manage to get the same output with the Hebrew characters as unicode entities.
I Googled around for a possible solution but found none.
I had a couple ideas in mind, but I'm not sure exactly how to approach them, if at all (maybe someone has a better solution).
- I thought maybe I could (after processing the page) scan the page for unicode entities and replace them with the corresponding Hebrew characters (in a systematic way, of course).
- Maybe I could take the HTML Tidy source code and modify it to output Hebrew characters appropriately. The problem with this is that I doubt I am knowledgeable enough to even get started on something like this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有类似的问题。 UTF-8 格式的文档,包含 unicode 字符。 HTML Tidy 将它们转换为 HTML 实体。 HTMLTIDY.CFG 中的这个修复了它:
希望它有帮助。
I had a similar problem. Document in UTF-8, containing unicode characters. HTML Tidy turned them into HTML entities. This in HTMLTIDY.CFG fixed it:
Hope it helps.
您使用的网站 http://infohound.net/tidy/ 有一个“Char 编码”子句右下角。您需要选择 utf-8,但首先需要确保页面在测试编辑器中以 UTF-8 编码。例如,在 Notepad++ 中,您可以转到
Encoding >转换为无 BOM 的 UTF-8
。The website http://infohound.net/tidy/ that you are using has a "Char encoding" clause at the bottom right. You need to choose utf-8, but first you need to make sure that the page is encoded in UTF-8 in your test editor. In Notepad++ for example, you can go to
Encoding > Convert to UTF-8 without BOM
.