Skip to Main Content

Data Science & Machine Learning

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Special characters not displaying correctly

3240586May 17 2016 — edited Aug 10 2016

I have a similar question to Charset problem on R console; it's not clear what the resolution of that thread was. Essentially, when I query the Oracle instance for a string containing accented characters, they are not properly returned. In the MWE below, the string 'àáâã' is not correct. Any help is greatly appreciated, thanks in advance.


> library(ROracle)

> drv <- dbDriver("Oracle")

> con <- dbConnect(drv, username = "user", dbname = "db", password = "password")

> x <- "àáâã"

> x

[1] "àáâã"

> qry <- paste0("select '",x,"' from dual")

> dbGetQuery(con, qry)

  'AAA?'

1   aaa?

> dbGetQuery(con, "select * from nls_database_parameters")

                 PARAMETER                        VALUE

1             NLS_LANGUAGE                     AMERICAN

2            NLS_TERRITORY                      AMERICA

3             NLS_CURRENCY                            $

4         NLS_ISO_CURRENCY                      AMERICA

5   NLS_NUMERIC_CHARACTERS                           .,

6         NLS_CHARACTERSET                     AL32UTF8

7             NLS_CALENDAR                    GREGORIAN

8          NLS_DATE_FORMAT                    DD-MON-RR

9        NLS_DATE_LANGUAGE                     AMERICAN

10                NLS_SORT                       BINARY

11         NLS_TIME_FORMAT               HH.MI.SSXFF AM

12    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM

13      NLS_TIME_TZ_FORMAT           HH.MI.SSXFF AM TZR

14 NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR

15       NLS_DUAL_CURRENCY                            $

16                NLS_COMP                       BINARY

17    NLS_LENGTH_SEMANTICS                         BYTE

18     NLS_NCHAR_CONV_EXCP                        FALSE

19  NLS_NCHAR_CHARACTERSET                    AL16UTF16

20       NLS_RDBMS_VERSION                   11.2.0.3.0

> sessionInfo()

R version 3.3.0 (2016-05-03)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows >= 8 x64 (build 9200)

locale:

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252

[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252   

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:

[1] ROracle_1.2-2 DBI_0.4-1   

loaded via a namespace (and not attached):

[1] tools_3.3.0

This post has been answered by Sherry Lamonica-Oracle on May 18 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2016
Added on May 17 2016
2 comments
2,776 views