New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding parameter in dbConnect
#153
Comments
|
@etienne-s thanks for the comment, it really helped me on my Win7-Machine. But we switched to Win10, now it seems like, the encoding-Setting is not helping anymore. I have issues when Inserting data with R-DBI-Package (Database: ORACLE 19c, R-DBI Version 1.1.1, R-odbc Version 1.3.2) - when Importing Data to Database, the special characters in German (Umlaute 'ÄÖÜ') is imported like '¿¿¿¿¿¿¿¿'. I tried several things, like using iconv, enc2utf8 on the data-frame etc, or different encoding-settings in DBI::dbConnect(odbc::odbc(), ... encoding = 'latin1' or 'ISO8859-1' etc..., but it didn't work... Any advice? I also should have mentioned, that I was running R 3.6.1 on Win7-Machine, while I'm running R 4.0.4 on Win10-Machine. An old-fashioned INSERT INTO statement how ever does work: Now I also found out, when I switch to the 32-bit-Version, it works, so I can use the dbSendStatement/dbBind/dbClearResult, when Inserting and dbGetQuery when selecting Data from the DB? (But I'm not sure, why it does not work with the 64-bit-Version) |
|
The above described problem occured because the charset for the installed odbc-driver has not been set. So now it works with 32-bit-odbc-driver and 64-bit-odbc-driver. Just wanted to mention this, if somebody else has similar issues -> in that case, contact your database-admin, and tell them to set the right charset in the odbc-driver! |
In
?odbc::dbConnectone can read the following about theencodingparameter (emphasis mine):However, my local encoding is "windows-1252" and when I connect to an SQL Server database I observe that:
encoding = "", I get windows-1252 encoded strings decoded as UTF-8 (so I get\xe9instead ofé).encoding = "windows-1252", I get UTF-8 encoded strings properly decoded as UTF-8.So maybe the docs need a change.
Session Info
The text was updated successfully, but these errors were encountered: