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.
Asked
Active
Viewed 329 times
0
-
1Do 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 Answers
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
-
I connected with DBMSencoding set to 'latin1' but it still gives me question marks :/ – Irakli Salia May 11 '20 at 19:56
-
-
-
-
Unfortunately no, is there a way to view what is there any other way to view the encoding of the server? – Irakli Salia May 12 '20 at 06:45
-
Have a look at :https://stackoverflow.com/questions/5182164/sql-server-default-character-encoding – Waldi May 12 '20 at 13:17