[unixODBC-support] Charset problem with odbc connection on AS400

KRAFT Benjamin benjamin.kraft at synergies-msr.lu
Fri Sep 9 14:12:39 BST 2005


Hello the list,

I'm writing here this mail because of incorrect characters displaying when
getting informations from one AS400 and trying to display it on a web page
with php.

My server is running debian linux, and the unixODBC driver that i downloaded
from ibm's web page is the following :

iSeriesODBC-5.1.0-0.16.i386.rpm

*here is my /etc/odbcinst.ini :
[iSeries Access ODBC Driver]
Description             = iSeries Access for Linux ODBC Driver
Driver          = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
Setup           = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
Threading               = 2
FileUsage               = 1
DontDLClose             = 1

*here is my /etc/odbc.ini :
[Pos400]
Description = test to as400
Driver = iSeries Access ODBC Driver
Server = as400
System = as400
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowUnsupportedChar = 1
DefaultLibraries        = QGPL
ConnectionType          = 2
CommitMode              = 1
ExtendedDynamic         = 0
DefaultPkgLibrary       = QGPL
DefaultPackage          = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression    = 0
LibraryView             = 1
ForceTranslation        = 1
Trace           = 0

*Here is my php code :
<?
 $string = "";
 $hDB=odbc_connect( 'POS400','**user**','**pass**');
 if ( empty($hDB))
    {
    echo "no connection...";
    die();
    }else   {
            $sql = "select * from CONTRATS.CENDMI WHERE CC=3005 AND
NCONT='003005' and ORDMI=44";
            $resultat = odbc_exec($hDB, $sql);
            odbc_result_all($resultat);
        }

odbc_close($hDB);
?>

*This displays :
<table><tr><th>CC</th><th>NCONT</th><th>ORDMI</th><th>NLMISS</th><th>DESOE</
th></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>1</td><td>Inspection
approfondie de la chambre de combustion </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>2</td><td>Ramonage par
aspirateur ou procd chimique        </td></tr>

<tr><td>3005</td><td>003005</td><td>44</td><td>3</td><td>Nettoyage de la
buse  fumes                      </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>4</td><td>Contrle de
l'tanchit des portes et carneaux    </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>5</td><td>Contrle de
l'isolation                            </td></tr>
</table>

*This *SHOULD* be :
<table><tr><th>CC</th><th>NCONT</th><th>ORDMI</th><th>NLMISS</th><th>DESOE</
th></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>1</td><td>Inspection
approfondie de la chambre de combustion </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>2</td><td>Ramonage par
aspirateur ou procédé chimique        </td></tr>

<tr><td>3005</td><td>003005</td><td>44</td><td>3</td><td>Nettoyage de la
buse à fumées                      </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>4</td><td>Contrôle de
l'étanchéité  des portes et carneaux    </td></tr>
<tr><td>3005</td><td>003005</td><td>44</td><td>5</td><td>Contrôle de
l'isolation                            </td></tr>
</table>

And I really don't know why this accents are not displaying.
When doing the same request on windows, I get the accents displayed.

Does anyone have a clue ?

Thanks in advance.

BK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3089 bytes
Desc: not available
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20050909/d0fb7a23/attachment.bin>


More information about the unixODBC-support mailing list