on 2023 Feb 07 2:05 AM
Hi
The Chinese characters stored under varchar column are displayed correctly in isql (in both unix & windows). But it shows junk characters if we try to view this column using Power Builder & interactive SQL (on windows).
Does anyone know the way to fix it?
The default character set in ASE server is iso_1. ASE version is 16 SP04 PL03.
Powerbuilder version 2019 build 2082
thanks
The iso_1 character set doesn't include Chinese characters, so it sounds like this system has been set up to spoof the characer set. The client is taking values encoded in some other character set (UTF8 or some other multi-byte Chinese character set), connecting to ASE claiming to be using iso_1 to avoid character set conversion to insert the encoding.. The process can be reversed by a client that also connects indicating it is using iso_1 to extract the value and then displaying the value interpreted by the original encoding.
Powerbuilder and interactive SQL on Windows are likely using the cp850 character set, so character set conversion is changing the values of some bytes that map to different characters in iso_1 and cp850, resulting in junk characters when the converted values are interpreted as the original multi-byte character set.
To store Chinese characters in an ASE that is using iso_1 as the default character set, you can use a univarchar column instead of varchar. That allows you to store unicode-encoded chinese characters in that column without character set conversion while continuing to store iso_1 data in all other char and varchar columns.
Alternatively (and particularly if you think the future will hold increasing use of multiple language data in more columns in the database), the server should be set up to use UTF8 as the default character set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your explanation Bret. It is a big database. We want to store Chinese name only in 2 tables. So we don’t want to make default character set to utf8 and will not be able to rebuild the whole database. So, we want to keep default character set to iso_1.
isql displays the Chinese name stored under column varchar correctly but not under column univarchar. We have set the dbparam of Powerbuilder with charset iso_1 but still Powerbuilder is showing corrupted characters (Chinese name from both varchar and univarchar columns). Powerbuilder displays the Chinese name correctly (from varchar column) if we make Windows display language to Chinese by configuring Language locales of Window systems to Chinese from us_english. But We don’t want to change the Window display language to Chinese so are looking for a better fix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
8 | |
7 | |
7 | |
6 | |
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.