Gentoo Archives: gentoo-server

From: KRAFT Benjamin <benjamin.kraft@×××××××××××××.lu>
To: gentoo-server@l.g.o
Subject: [gentoo-server] Charset problem with odbc connection on AS400
Date: Fri, 09 Sep 2005 14:08:17
Message-Id: 1126275084_537292@hyperion
1 Hello the list,
2
3 I'm writing here this mail because of incorrect characters displaying when
4 getting informations from one AS400 and trying to display it on a web page
5 with php.
6
7 My server is running debian linux, and the unixODBC driver that i downloaded
8 from ibm's web page is the following :
9
10 iSeriesODBC-5.1.0-0.16.i386.rpm
11
12 *here is my /etc/odbcinst.ini :
13 [iSeries Access ODBC Driver]
14 Description = iSeries Access for Linux ODBC Driver
15 Driver = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
16 Setup = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
17 Threading = 2
18 FileUsage = 1
19 DontDLClose = 1
20
21 *here is my /etc/odbc.ini :
22 [Pos400]
23 Description = test to as400
24 Driver = iSeries Access ODBC Driver
25 Server = as400
26 System = as400
27 DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
28 AllowUnsupportedChar = 1
29 DefaultLibraries = QGPL
30 ConnectionType = 2
31 CommitMode = 1
32 ExtendedDynamic = 0
33 DefaultPkgLibrary = QGPL
34 DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
35 AllowDataCompression = 0
36 LibraryView = 1
37 ForceTranslation = 1
38 Trace = 0
39
40 *Here is my php code :
41 <?
42 $string = "";
43 $hDB=odbc_connect( 'POS400','**user**','**pass**');
44 if ( empty($hDB))
45 {
46 echo "no connection...";
47 die();
48 }else {
49 $sql = "select * from CONTRATS.CENDMI WHERE CC=3005 AND
50 NCONT='003005' and ORDMI=44";
51 $resultat = odbc_exec($hDB, $sql);
52 odbc_result_all($resultat);
53 }
54
55 odbc_close($hDB);
56 ?>
57
58 *This displays :
59 <table><tr><th>CC</th><th>NCONT</th><th>ORDMI</th><th>NLMISS</th><th>DESOE</
60 th></tr>
61 <tr><td>3005</td><td>003005</td><td>44</td><td>1</td><td>Inspection
62 approfondie de la chambre de combustion </td></tr>
63 <tr><td>3005</td><td>003005</td><td>44</td><td>2</td><td>Ramonage par
64 aspirateur ou proc_d_ chimique </td></tr>
65
66 <tr><td>3005</td><td>003005</td><td>44</td><td>3</td><td>Nettoyage de la
67 buse _ fum_es </td></tr>
68 <tr><td>3005</td><td>003005</td><td>44</td><td>4</td><td>Contr_le de
69 l'_tanch_it_ des portes et carneaux </td></tr>
70 <tr><td>3005</td><td>003005</td><td>44</td><td>5</td><td>Contr_le de
71 l'isolation </td></tr>
72 </table>
73
74 *This *SHOULD* be :
75 <table><tr><th>CC</th><th>NCONT</th><th>ORDMI</th><th>NLMISS</th><th>DESOE</
76 th></tr>
77 <tr><td>3005</td><td>003005</td><td>44</td><td>1</td><td>Inspection
78 approfondie de la chambre de combustion </td></tr>
79 <tr><td>3005</td><td>003005</td><td>44</td><td>2</td><td>Ramonage par
80 aspirateur ou procédé chimique </td></tr>
81
82 <tr><td>3005</td><td>003005</td><td>44</td><td>3</td><td>Nettoyage de la
83 buse à fumées </td></tr>
84 <tr><td>3005</td><td>003005</td><td>44</td><td>4</td><td>Contrôle de
85 l'étanchéité des portes et carneaux </td></tr>
86 <tr><td>3005</td><td>003005</td><td>44</td><td>5</td><td>Contrôle de
87 l'isolation </td></tr>
88 </table>
89
90 And I really don't know why this accents are not displaying.
91 When doing the same request on windows, I get the accents displayed.
92
93 Does anyone have a clue ?
94
95 Thanks in advance.
96
97 BK

Attachments

File name MIME type
smime.p7s application/x-pkcs7-signature

Replies

Subject Author
Re: [gentoo-server] Charset problem with odbc connection on AS400 Patrick Lauer <patrick@g.o>