Topic
  • 4 replies
  • Latest Post - ‏2013-03-12T09:20:57Z by odb
odb
odb
5 Posts

Pinned topic apache+php+driver for odbc cli - connect problem with character conversion

‏2013-03-04T10:41:56Z |
when I try connect to remote db using web aplication (apache+php), I get error "IBMCLI Driver SQL0332N Character conversion from the source code page "819" to the target code page "UNKNOWN" is not supported. SQLSTATE=57017"

Php script executed directly (php -f sctipt.ph) is working. Also connection throught isql command working too.
Server - win2003 db2 9.5 codepage 1250
Client - linux 64.bit Debian Squeeze, ibm client 10.1, codepage utf-8.

attached trace log file

odbc.ini
db
Description = Test to DB2
Driver = DB2

odbcinst.ini
ODBC
Trace = yes
Tracefile = /tmp/odbc.log

DB2
Description = DB2 Driver
Driver = /opt/ibm/db2/odbc_cli/clidriver/lib/libdb2o.so
FileUsage = 1
DontDLClose = 1

db2cli.ini
COMMON
Trace=1
TracePathName=/temp/
TraceComm=1
TraceFlush=1
TraceTimeStamp=1

db
Database=db_name
Protocol=TCPIP
Port=50000
Hostname=192.168.0.117
DisableUnicode=1
If remote database is with utf-8 codepage, connection from web application works. I can`t change remote db codepage.
Ondrej
Updated on 2013-03-12T09:20:57Z at 2013-03-12T09:20:57Z by odb
  • nivanov1
    nivanov1
    53 Posts

    Re: apache+php+driver for odbc cli - connect problem with character conversion

    ‏2013-03-04T14:41:55Z  
    Check if Apache passes correct environment variables when it invokes PHP; the DB2 driver will use LANG or LC_CTYPE variables to determine the client code page.
  • odb
    odb
    5 Posts

    Re: apache+php+driver for odbc cli - connect problem with character conversion

    ‏2013-03-08T13:33:12Z  
    • nivanov1
    • ‏2013-03-04T14:41:55Z
    Check if Apache passes correct environment variables when it invokes PHP; the DB2 driver will use LANG or LC_CTYPE variables to determine the client code page.
    How can I check Apache? I`m not familiar with Apache.
  • odb
    odb
    5 Posts

    Re: apache+php+driver for odbc cli - connect problem with character conversion

    ‏2013-03-08T14:51:35Z  
    • odb
    • ‏2013-03-08T13:33:12Z
    How can I check Apache? I`m not familiar with Apache.
    Solved by adding line to db2cli.ini

    ConnectCodepage=1
    I found this here -> http://support.mdl.ru/Pc_compl/Doc/Db2/v7.1/en/Html/db2ir/db2ir314.htm

    or in Call Level Interface Guide and Reference, Volume 1

    Find something in huge IBM documentation is very hard, sometimes.
  • odb
    odb
    5 Posts

    Re: apache+php+driver for odbc cli - connect problem with character conversion

    ‏2013-03-12T09:20:57Z  
    • odb
    • ‏2013-03-08T14:51:35Z
    Solved by adding line to db2cli.ini

    ConnectCodepage=1
    I found this here -> http://support.mdl.ru/Pc_compl/Doc/Db2/v7.1/en/Html/db2ir/db2ir314.htm

    or in Call Level Interface Guide and Reference, Volume 1

    Find something in huge IBM documentation is very hard, sometimes.
    Previous post was wrong. It is not solution

    Solution

    Edit line in /etc/apache2/envvars (Debian)

    from export LANG=C to export LANG=en_US.utf8