泰语字符的字符编码
我需要读取包含泰语字符的 RTF 文件并将其写入文本文件。 我尝试使用 TIS-620、MS874、ISO-8859-11,但当我在记事本或文本板中打开生成的输出文件时,泰语字符无法正确显示。 但它与写字板配合得很好。 请指导我。
I have a requirement to read a RTF file with Thai characters and write it to a text file. I tried using TIS-620, MS874, ISO-8859-11, but Thai characters are not displaying properly when I open the resulting output file in notepad or textpad. But it works well with Wordpad. Please guide me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决问题的代码(发布在评论中,添加到此处以使其可读!):
Code that solved the problem (posted in comment, adding here to make it readable!):
我不认为记事本可以处理所有字符编码,只需谷歌搜索一下。 您能否尝试将字符重新编码为 UTF-8(或其他某种 unicode 格式),因为记事本可以正确处理该字符? 您将想要使用 BOM。
我还偶然发现了一个用于将泰语文件转换为各种其他编码的工具。
最后,是否要求文件可以用记事本打开? 记事本并不是文本编辑的最后一个词。
I don't think notepad handles all character encodings, from a little Googling. Could you try re-encoding the characters into UTF-8 (or some other unicode format), since Notepad does handle that correctly? You'll want to use the BOM.
I also stumbled across a tool for converting files in Thai into various other encodings.
Finally, is there a requirement that the files can be opened in Notepad? It's not as if Notepad is the last word in text editing.