There is correct charset=gb2312, which is also the content of the web page.
>doc<-xmlRoot(xml)
>doc[[1]]
<head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>娣卞湷鍥芥姇</title>
The charset has been changed to UTF-8.
> doc1<-xmlRoot(xml,encoding="gb2312")
> doc1[[1]]
<head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>娣卞湷鍥芥姇</title>
It seems that some methods of XML will change the charset to UTF-8 on their
own will.
> ______________________________________________
> R-h...@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
--
View this message in context: http://www.nabble.com/Chinese-characters-encoding-problem-with-XML-tp21225957p21230340.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.