On Db2 v11.5.7 on Linux/x86_64 I have a UTF-8 database.
db2 get db cfg for test1 returns:
Database code page = 1208 Database code set = UTF-8
On my Windows 10 computer in Putty I have set: Window | Translation | Remote character set to UTF-8. I can properly see non-English characters in Putty.
I have also installed DBeaver tool and I can also properly see non-English characters.
The problem I have is "db2cmd" tool.
In Putty remote connection I created tables and inserted one character:
db2 "connect to test1 user db2inst1 using db2inst1" db2 "create table admin.test8 (id int not null generated always as identity, a varchar(20))" db2 "insert into admin.test8 (a) values ('č')" db2 "select id, a, hex(a) as hex_a from admin.test8 order by id"
Output of select statement is (which is correct):
If I do the same in DBeaver:
insert into admin.test8 (a) values ('č'); select id, a, hex(a) as hex_a from admin.test8 order by id;
Both Putty and DBeaver correctly inserts character in database.
Now saving the commands into UTF-8 encoding:
From db2cmd I check for the code page:
and output is:
Active code page: 1252
Execute commands: db2 -tf a.sql
Output in column A is completely wrong. In ID=3 also HEX_A is completely wrong.
I tried several things like:
But in both cases I see the same result as last command.
If I try to connect with "-a" switch I get Db2 server code page is 1208 (utf-8) and Db2 client code page is 1252.
Now to configure db2cmd to properly handle the UTF-8 code-page?