简体   繁体   中英

PHP ibm_db2 how to change CONN_CODEPAGE to 1208

I have a db2 database with this charset options:

db2 get db cfg for CORRETGE
    Database territory       = US
    Database code page       = 1208
    Database code set        = UTF-8

But when I connect to the database from a PHP 5.4.1.RC1 script with db2_connect() , I get this CONN_CODEPAGE:

public 'APPL_CODEPAGE' => int 819
public 'CONN_CODEPAGE' => int 819

Database has 1208 (UTF-8 encoding of Unicode) codepage and the connection has 819 (ISO8859-1) codepage, and this provoque charset problems.

I don't know how to set 1208 as the CONN_CODEPAGE. Is there any way to do it?

FIXED

Set the DB2CODEPAGE variable to 1208 with the command

  db2set DB2CODEPAGE=1208

and restart DB2

now db2_client_info() returns

public 'APPL_CODEPAGE' => int 1208
public 'CONN_CODEPAGE' => int 1208

and the results are the expected :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM