0

I have trouble importing data from SQL Server with RODBC package. While importing, the process is smooth and imports quite nicely but there is a problem with unicode characters. They are changed to question marks(?). Have any of you ever come across this problem? If yes please tell me how you've resolved it.

GordonShumway
  • 1,980
  • 13
  • 19
  • 1
    Do you mean in rstudio or in your output, see https://support.rstudio.com/hc/en-us/articles/200532197-Character-Encoding – Bruno May 11 '20 at 18:09
  • In rstudio, when you view dataset or subset anything from column which contains unicode I get question marks only, meaning it isn't reading the unicode characters – Irakli Salia May 11 '20 at 18:17

1 Answers1

0

The DBI package allows to set the encoding in the connexion descriptor to avoid special characters being transformed into question marks :

conn <- DBI::dbConnect(
                      odbc::odbc(),
                      Driver = "SQL Server",
                      ...,
                      encoding = "latin1"
                      )

In RODBC, you should also be able to set the DBMSencoding parameter

Waldi
  • 39,242
  • 6
  • 30
  • 78