[R] FW: R encoding question
guxiaobo1982 at gmail.com
Mon Nov 29 14:18:16 CET 2010
But Sys.setlocale tries to change the option of the whole OS, I just want only R to use a specified encoding, how can I do this.
>>From: Gabor Grothendieck [mailto:ggrothendieck at gmail.com]
>>Sent: Monday, November 29, 2010 8:57 PM
>>To: Xiaobo Gu
>>Subject: Re: FW: R encoding question
>>I have never played with encodings myself. Suggest you read the postgresql
>>documentation and try different arguments to Sys.setlocale in R. You
>>probably have to do that before you initiate the database since it might not
>>have any effect afterwards. I am not sure this is the problem but its worth a try.
>>Here are some examples.
>>2010/11/29 Xiaobo Gu <guxiaobo1982 at gmail.com>:
>>> Can you help with this.
>>> Xiaobo Gu
>>> -----Original Message-----
>>> From: Xiaobo Gu [mailto:guxiaobo1982 at gmail.com]
>>> Sent: Wednesday, November 24, 2010 10:19 PM
>>> To: r-help at r-project.org
>>> Subject: R encoding question
>>> I am using RpgSQL to retrieve data from a PostgreSQL database wich is
>>> with encoding UTF8, and I have some Chinese character in one of the
>>> columns, unfortunately R can't show it correctly.
>>>> df <- dbGetQuery(con, "select * from test") df
>>> a b
>>> 1 1 椤惧皬娉\xa2
>>> 2 2 瑕冩 EURO\xa1
>>> I see the following option, do I need to change the encoding option to
>>> show the corresponding texts? In my case how to set?
>>>  "native.enc"
>>> Xiaobo Gu
>>Statistics & Software Consulting
>>GKX Group, GKX Associates Inc.
>>email: ggrothendieck at gmail.com
More information about the R-help