[R] How to use internationalization of R on Linux?

Milan Bouchet-Valat nalimilan at club.fr
Mon Oct 15 18:42:24 CEST 2012


Le lundi 15 octobre 2012 à 05:37 -0700, Manish Gupta a écrit :
> HI,
> 
> i need to use simplified chineese.  But when i read XML
> 
> <barplot> 
>             <cd> 
>                 <name>表</name> 
>                 <value1>3</value1> 
>                 <value2>2.9</value2> 
>             </cd>   
>             <cd> 
>                 <name>笔</name> 
>                 <value1>3.3</value1> 
>                 <value2>3</value2> 
>             </cd> 
>             <cd> 
>                 <name>铅笔</name> 
>                 <value1>2.3</value1> 
>                 <value2>2.9</value2> 
>             </cd> 
>             <cd> 
>                 <name>书</name> 
>                 <value1>3.4</value1> 
>                 <value2>2.6</value2> 
>             </cd> 
>             <cd> 
>                 <name>玻璃</name> 
>                 <value1>3.1</value1> 
>                 <value2>2.4</value2> 
>             </cd> 
> </barplot> 
> 
> But when i real xml using XML package data is not in chineese format. I
> don't know how to read data in chineese language   when it in XML format
> using UF8. Can u pls help me by posting any working example.
The burden of the reproducible example is on the poster, not one people
who reply ! ;-)

More seriously, you should really tell us what code you are using to
read the file. I know there can be differences according to whether you
set internal=TRUE or not when calling xmlTreeParse(), because when
internal=FALSE readLines() is used to read the contents of the file. You
should also try passing encoding="UTF-8" if your file does not specify
it.


Regards




More information about the R-help mailing list