RODBC in Oracle Database and Special Characters

Sorry if I am asking a question that has already asked a question, I did find some similar questions (like Special Characters and RODBC for example) on this forum, but there is no answer help me ...

So my problem is that when I make a query in an Oracle database, via a RODBOC in R, I cannot correctly see the special characters in reverse order. R automatically converts (when possible) special characters to regular characters

Here's a simple test I did:

> Cnx <- odbcConnect(dsn="myDSN", uid="myLogin",pwd="myPassword")
> sqlQuery(Cnx, paste("SELECT 'eĆ©ĆØĆŖĆ«Ć„ĆŠĆĆ•Ć˜' col FROM DUAL"))
         COL
1 eeeeeAEI??

      

I am on Win7 x64, "myDSN" is an ODBC connection that uses "Oracle in OraClient12home1" (64 bit). I am using "R x64 3.2.0" with RODBC package version 1.3-11. The database is on linux server, NLS_CHARACTERSET is "WE8MSWIN1252"

I did other tests to understand better:

  • Same tests with ODBC connection using "Oracle in OraClient12home1_32bit" with "R i386 3.2.0" => Same problem
  • Same tests with ODBC connection on local SQL server => No problem, I can see special characters
  • The same query with the same ODBC connection in MS Excel => Not a problem either

I tried to play with the DBMSencoding parameter, with "UTF-8" I have the same problem, with others, I have different errors ...

Here is my sessionInfo ()

R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RODBC_1.3-11

loaded via a namespace (and not attached):
[1] tools_3.2.0

      

thanks for the help

+3


source to share





All Articles