简体   繁体   English

编码问题:在R中将字节转换为汉字

[英]Encoding problem: Convert bytes to Chinese characters in R

I read from a html file in R which contains Chinese characters.我从 R 中的 html 文件中读取,其中包含中文字符。 But it shows something like但它显示了类似的东西

"    <td class=\"forumCell\"><a href=\"#\" onClick=\"if(confirm('\xc4\xe3\u0237\xd0\xc5Ҫ\xbbָ\xb4\xb8\xc3\xce\xc4\xd5\xc2\xc2\xf0\xa3\xbf')){location.href='articleBakAdmin.php?action=restore&articleID=120516';}\">\xbbָ\xb4</a></td>"

It is the "\\x" strings that I need to extract.这是我需要提取的“\\x”字符串。 How can I convert them into readable Chinese characters?如何将它们转换成可读的汉字?

By the way, somehow simply copy and pasting the above \\x strings would not replicate the problem.顺便说一句,以某种方式简单地复制和粘贴上面的 \\x 字符串不会复制问题。

are you sure they are all chinese characters?你确定它们都是汉字吗? what is the html page encoding?什么是html页面编码? the strings you pasted looks to be a mix of hex \\xc4\\xe3 and unicode chars .您粘贴的字符串看起来是 hex \\xc4\\xe3和 unicode chars

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

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