-
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
German letters (ä,ö,ü) not displayed correctly #46
Comments
Could you clarify a little? What part of the system is in CCSID 1141? The entire system, the database table, or the column? Perhaps you could send the results of a |
There are a lot of different technologies that the data flows through to call and then receive data from the database. I think the most interoperable solution for getting data out is to make sure your connection string includes the |
Setting the CCSID to 1208 solved my problem, thank you very much! |
Hi Mark, I'm afraid I still your help. In my case CCSID=1208 didn't worked. I tried it in the connection string and also in ODBC.INI and ODBCINIST.INI without success. Please note that our database is a Pervasive (now Actian) PSQL database. We tried CCSID=1252 since this is how the database is configured (see below) We also tried to change PvTranslate to auto in the connection string without success (https://docs.actian.com/psql/psqlv13/index.html#page/odbc%2Fodbcadm.htm%23ww1224120). We also tried to change the encoding translation mode in the connection attributes. So far all we manage to do is getting + signs instead of � where there should be 'é' ODOBCINIT.INI: [Pervasive ODBC Interface (32 bit)] ODBC.INI [DEVTABLES_ODBC] Thanks |
The CCSID keyword is unique to the IBM i ODBC connector, so it would make sense that it wouldn't work for your Actian PSQL ODBC driver. So get rid of that line in your ODBCINIT.INI and ODBC.INI, it won't help you. I think this Actian ODBC guide might help you out, especially starting at page 24: https://communities.actian.com/servlet/fileField?entityId=ka3f3000000PT3QAAW&field=Attachment1__Body__s I don't have the database set up yet so I can't test myself, but I would think that Windows-1252 would work, since it contains code points for those characters that are coming as �. Let me know if the PDF doesn't give you clues and help point you in the right direction, and I can maybe try to download and test myself to find the right combination |
Hi Mark, Our connection string was not right: DSN=DEVTABLES_ODBC;DATABASE=DEVTABLES DSN=DEVTABLES_ODBC;ServerName=data02.1583;PvTranslate=auto;ArrayFetchOn=1;ArrayBufferSize=8;TransportHint=TCP:SPX;DBQ=DEVTABLES;ClientVersion=11.31.070.000;CodePageConvert=1252;PvClientEncoding=CP1252;PvServerEncoding=CP1252;AutoDoubleQuote=0; This string in fact came from MS Excel. It's the string Excel generate when it connects to the database using ODBC. There is a few odd things with this however. The parameters CodePageConvert, PvClientEncoding and PvServerEncoding are not mentionned in the Pervasive manual, even in the most recent version. I'm not sure why Excel adds them. This string works in Node Red and return results but again, the accented characters are converted to � which is killing me since Excel doesn't have any issue reading them. There is this line in the manual: Note When using the PSQL Client driver, Unicode SQL text is always converted to the client encoding by the Microsoft Driver Manager. This restricts NCHAR literals in a SQL query string to the character set of the client. To preserve NCHAR literals in SQL query text, use the PSQL Unicode driver. Not sure that we understand this correctly but if the Microsoft Driver manager detects that the app is using EBCDIC, it will try to convert to EBCDIC??? We started to look for the PSQL Unicode driver. We noted that the v11 manual (which we use) barely mention Unicode at all. However Unicode is all over the place in the v12 manual. We will try to install v12 Unicode driver and see how it goes. |
Hi Mark, Interestingly, Excel generate this connection String: DSN=DEVTABLES_ODBC;ServerName=data02.1583;PvTranslate=auto;ArrayFetchOn=1;ArrayBufferSize=8;TransportHint=TCP:SPX;DBQ=DEVTABLES;ClientVersion=11.31.070.000;CodePageConvert=1252;PvClientEncoding=CP1252;PvServerEncoding=CP1252;AutoDoubleQuote=0; However, those parameters : ClientVersion=11.31.070.000;CodePageConvert=1252;PvClientEncoding=CP1252;PvServerEncoding=CP1252;AutoDoubleQuote=0; We tried the Pervasive Unicode Client Interface without success (v12, 32 bits and 64 bits). Note that the database uses v11. We can install the client and it can see the databases but we cannot test the connection in the windows odbc utility and any attempt to query the database results in a crash. This may be because the databse itself is v11 (not the unicode version). We just don't know.... So long story short we're stuck. By the way, is there any chance the issue could be caused by my js Node Red script (which uses odbc.js), like if it would not pass the string properly? I'm asking just in case... Regards, |
Hi Mark, For reference, please note that we solved this today. It was fairly simple after all. Our database uses CP1252. Same thing for the client and the server. We were puzzled for quite a while since to us there was no reason for this not to work out of the box. Moreover, "é" is the same hex code in quite a lot of code pages, including extended ASCII. However, when trying an SQL INSERT INTO, we noticed that the resulting string in the database was obviously UTF8 hex values. I guess this comes from the fact HTML5 and thus probably Node Red too use UTF8 by default. There is probably a way to force everything to CP1252 in the HTML code but is was easier to set the client locale to use UTF8 and then set the driver to automatic translation. The driver now recognizes that the client is UTF8 while the database is CP1252 and does the translation accordingly. Et voilà! Cheers |
Hello mamorneau, I would like to ask you a question, we have the same problema that you but the letter “ñ”, we have Pervasive database and I openend a issue whit this problema #28, I tried to do some tests but didn't worked. Could you told us what you you did to fixd the problem? |
The Node API only provides functions to create String objects from UTF-8 bytes or UTF-16 bytes, thus node-odbc will always assume the driver returns UTF-8 bytes. On Windows, this is fairly unlikely as almost nobody runs with this beta UTF-8 locale setting. I suspect we'll need to build in UNICODE mode on Windows to force all the wide APIs. This ensures that we have a consistent UTF-16 encoding for pulling data into or out of Node.js. |
Hello, then are you having the problem when you have received the data, aren't you? Because I have the problem with the query, on the selec, I thought the problem was with the query, I don't know if this will fix my problem. |
Hi yuguifly. We had the issue with both sending and receiving. If the query string contained accented characters the query would simply fail just like in your case. If the query string had no accented characters then we were receiving a reply from the DB but the accented characters were corrupted. The Windows UTF8 mode of course solved both issues at the same time. That being said I think sending is not as much an issue since the query string is not a javascript object so it should be possible to encode it from UTF8 to CP1252 within the javascript code using iconv before it is sent to the ODBC driver. If the data you are trying to read doesn't contain accented characters (and thus only the query string is causing problem) it could be worth a try. |
Hello, I tried to do that, markdirish told me that but this didn’t worked, I don’t know if i did this well, I put this on the pervasive conennection "DSN= ; encoding=Cp1252; UID=; PWD=;" and I changed on de odbc encoding translation to outomatic too, but doesn’t work. I tried another encoding with the same result. thank you |
Hi yuguifly, I think "encoding=CP1252" is specific to other types of databases and is not supported by the pervasive driver. We are pretty much stuck with the translation modes "none", "oem/ansi" and automatic. I have not played much with the oem/ansi mode. This comes from the manual and is quite interesting: OEM/ANSI Conversion SQLDriverConnect uses a DSN-less connection: This implies that the windows UTF8 mode is not absolutely required to make this work. I think we tried this initially but failed because at that moment we were using a 32bits DSN. FYI this is our connection string. Works fine with the UTF8 mode. DSN=TABLES_ODBC64;ServerName=data02.1583;DBQ=TABLES Regards |
FYI, I had the same problem with a SAP SQL Anywhere database on windows (Client and Server). Adding "CharSet=UTF-8" to the connection string did fix the issue. Update: I'm not sure if I made a typo with "UTF-8", but recently I used "CharSet=utf8" without the dash with some success. So maybe trying some variants can help... |
Having the same issue on [email protected] against a Progress Database. Also see #379 |
These letters are displayed as '�', queried from a IBM DB2 database with ccsid1141 encoding.
The text was updated successfully, but these errors were encountered: