-
Notifications
You must be signed in to change notification settings - Fork 77
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
[HELP] Change or define charset / encoding? #379
Comments
Update: I tried to add |
I have recently tried to use "CharSet=utf8" (without the dash), and had at least a partial success with SAP Anywhere database. Now writing to the database from node works at least for the characters supported by the locally configured codepage (in my case 1252), and maybe even some more. Sadly, at least in my setup, it did not help to write the more remote codepoints... :-\ |
@jmbluethner setting the charset is a driver-specific thing, so it would help to know what driver you are using. |
Using the ODBC driver for SAP Anywhere 17 on Windows 10. According to ODBC Admin the version number is 17.00.11.6933. My guess is that this is not so much an issue of the database side of the driver, but the handling by the ODBC interface itself, and probably changing the local settings of Windows changes things. My regional settings are set to Germany, which (afaik) implies codepage 1252 "for non unicode programs". |
The current design of the node-odbc, even on Windows is that it binds all character data as SQL_C_CHAR and interprets it as UTF-8. If the driver does not support setting the local encoding, then this will fail for data which isn't UTF-8. There's an existing issue to support binding as SQL_C_WCHAR instead: #292 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm using Progress OpenEdge 11.7. I did some packet capturing while doing test connects in Windows ODBC settings to see what those requests look like, and I found out that there are two arguments which are beeing sent: I have than added these into my DSN connection string const connectStr = "DSN=<NAME>;HOST=<ADDR>;DB=<DB>;UID=<USER>;PWD=<PWD>;PORT=<PORT>;codePage=UTF-8;clobCodePage=UTF-8;"
try {
return await odbc.connect(connectStr);
} catch(e) {
console.log(e);
process.exit();
return false;
} Unfortunately I still have wrong encodings when logging the results :/ let res = [];
await connectToDatabase().then(async (conn) => {
res = await conn.query(<SQL_QUERY_STRING>);
await conn.close();
});
console.log(res);
return res; Result:
|
I now found out that there seems to be another argument called However, adding But as this seems to be a problem with my specific driver, and not a problem that's directly connected to node-odbc, I might close this issue. |
We had the same problem. I tried everything the only possible way for us was to host the nodejs server on a linux based system. Not all linux versions work. We use Hope this helps Regards from Germany |
@Relbot Thanks for your reply fellow German! :) I've now adjusted my entire repo to make the API run on linux as well, but unfortunately - No luck :( I've opened a ticket with Progress, so, we'll see. Best regards |
@jmbluethner which linux are you using ? |
@Relbot Debian 12. But that shouldn't make a difference, right? The ODBC drivers will be the same, no matter which distro it is. Or am I missing something? |
@jmbluethner Try Fedora Linux 38 (Workstation Edition). Installation is straightforward, but one issue remains: decimal numbers tend to lose their decimal places. #406 |
Hey there!
I was wondering if there's a way to adjust the charset? I can't find anything like that in the docs.
I'm from Germany, so we have quite a lot of datasets which contain special Characters like ä,ö,ü, Unfortunately, those show up as � characters.
Any help would be appreciated :)
Thanks in advance and have an amazing day.
The text was updated successfully, but these errors were encountered: