DBI connection to SQL Server (and Sybase 12.5) does not return Greek characters

I tried connecting to the Sybase database using a DBI package, but the queries do not return Greek characters correctly.

The same goes for connecting to the SQL server. The following is an example command dbConnect:

library(odbc)
con <- dbConnect(odbc::odbc(), .connection_string = "Driver={SQL Server};server=ATLAS;database=master;trusted_connection=true") 

I had no problems when I used RODBC (with the same system DSN)

enter image description here

Table of Contents:

enter image description here

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Greek_Greece.1253  LC_CTYPE=Greek_Greece.1253    LC_MONETARY=Greek_Greece.1253 LC_NUMERIC=C                 
[5] LC_TIME=Greek_Greece.1253    

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

other attached packages:
[1] odbc_1.1.1

loaded via a namespace (and not attached):
 [1] bit_1.1-12     compiler_3.4.1 hms_0.3        DBI_0.7        tools_3.4.1    tibble_1.3.4   yaml_2.1.14    Rcpp_0.12.12   bit64_0.9-7   
[10] blob_1.1.0     rlang_0.1.2  
+6
source share
1 answer

Try setting the parameter encodingto dbConnect(). Of?odbc::dbConnect

encoding: , .            , , "".           'Iconvlist()            . 'UTF-8           .

0

All Articles