on 2015 Apr 14 4:21 PM
Windows 7 English Sybase SQL Anywhere 12.0.1.3942
I have a database with char collation set to 936ZHO.
-- Database CHAR collation: 936ZHO, NCHAR collation: UCA -- Connection Character Set: GBK
I have entered Chinese into a char column.
With ISQL, I can see the correct Chinese characters in the output pane. If I access the records via ODBC with ado in VB6 and display the string via a unicode compatible mshflex grid control, the Chinese in the grid is displayed as garbage.
If I changed the database to this:
-- Database CHAR collation: UCA, NCHAR collation: UCA -- Connection Character Set: UTF-8
Chinese again is entered into a char column.
With no changes in code, the Chinese would be displayed correctly in the grid.
How I can read Chinese and display Chinese characters correctly when character set is GBK? Why ISQL is able to display Chinese correctly and ado via ODBC cannot?
Thank you for your help.
Request clarification before answering.
DBISQL is a java application and that natively uses Unicode (internally UTF32) and so the connection charset will be Unicode (UTF-16 I believe) and the server will translate the characters correctly knowing this.
I believe ADO is going through a generic (OLE/DB to ODBC) bridge and that software is limited and can have issues like this. You could try using the SQL Anywhere OLE/DB driver instead or set up the connection to request CHARSET=UTF-8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.