IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
38 stars 23 forks source link

Character not display correctly when using CCSID 836 for specified field #96

Closed benli2023 closed 4 years ago

benli2023 commented 4 years ago

Hi , I am reading the AS400 from old existing file , some field display correctly when using CCSID 935, However in the same file , there are other fileds using difference CCSID ,which it is 836 and fail to display correct symbol.

dmabupt commented 4 years ago

Hello @zhangwenzhuo , Are these fileds with CCSID 836 displayed correctly with other tools? Or it only fails with idb-connector?

dmabupt commented 4 years ago

CCSID 836 is a single byte charset. It can only represent these characters -- ftp://ftp.software.ibm.com/software/globalization/gcoc/attachments/CP00836.pdf

CCSID 935 is a double bytes charset. It can represent all 835 charset + many Chinese characters.

Acturally, 935=836+837

So if you encode any Chinese characters in CCSID 836, they can not be displayed correctly.

benli2023 commented 4 years ago

@dmabupt the file level ccsid is 935, and the field level ccsid is 836, i resolve the display issue workaround solution is using SQL convert ,such as " select cast( field as varchar(20) CCSID 935) as newfield"