I am using PHP to read files from the iSeries.
// Lesen von AS/400
$result=odbc_exec($source,"Select * from ECOLIB.ECP330");
// Feld entnehmen
If the the field read contains a german umlaut the variable $Bezeichnung will look fine up to the character before the umlaut, the rest is garbage.
We use Suse Linux Enterprise 9.
The locale codeset is UTF-8 (ccsid 1208).
Obviously something is wrong.
Does anybody know the screw I have to turn?
This topic has been locked.
10 replies Latest Post - 2007-07-10T06:18:41Z by Host
Pinned topic German Umlaute
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2007-07-10T06:18:41Z at 2007-07-10T06:18:41Z by Host
Re: German Umlaute2007-06-08T22:47:22Z in response to HostHi,
Can you tell us wich ccsid do you have in the database field / host column data?
273 (0x111) may be?
If this is the case, you may need to setup the environment where the PHP script process is being run under the same locale. This is:
- export LANG=de_DE
- php -f myscript.php
Or either from the same PHP script with:
Note that is not the same as "de_DE.utf8" or "de_DE.UTF-8", you must specify just "de_DE"
Try that and let us know if you still have the problem. That the case it will be helpfull if you can attach here the cwbtrc, cwbmedic and sql.log, let me know if you need more detailed instructions about how to use these tools included with the iSeriesAccess for Linux RPM
Re: German Umlaute2007-06-14T14:10:58Z in response to SystemAdmin> Hi,
> Can you tell us wich ccsid do you have in the
> database field / host column data?
> 273 (0x111) may be?
> Note that is not the same as "de_DE.utf8" or
> "de_DE.UTF-8", you must specify just "de_DE"
to my code.
> Try that and let us know if you still have the
Still have the problem.
cwbtrc with details is somewhat longish...
There are lines like "NL CONV:CONV NOT FOUND scp=819 tcp=500 siso=1 pad=4" in it.
Is there my problem?
AttachmentsUpdated on 2007-06-14T14:10:58Z at 2007-06-14T14:10:58Z by Host
Re: German Umlaute2007-06-15T08:07:13Z in response to HostHohum, maybe I found the problem.
Now I need a pointer to the solution...
I have a local (linux) ccsid of 1208 and a remote (iSeries) ccsid of 273.
I should have a conversion table in /opt/ibm/iSeriesAccess/conv_tables named 011104B8.tbl
I tried to download this table with /opt/ibm/iSeriesAccess/bin/cwbnltbl 273 1208
The table is still missing.
How do I get this table?
Re: German Umlaute2007-06-15T14:04:44Z in response to HostYes, indeed that what I think is the problem, and that's why I recommended you to set the PHP process locale to 273 using setlocale(). But if you say is not working even with the proper locale set, then may be is other problem.
can you execute this command:
- locale -a | grep de_DE
I want to be sure you have the proper locale support for de_DE, otherwise that's why the call to setlocale() is failing.
You say you have tried downloading the conversion table, however AFAIK, is probable that conversions are not that straightforward, so intermediate steps could be happening. ( 273 -> 13488 -> 1208 ), so not having a direct table from 273 to 1208 may not be the issue.
Have you already tried starting your whole Linux session in de_DE?
Have you already tried this?:
- export LANG="de_DE"
- php -f myscript.php
How do you test that fetched data has "garbage" after umlaut? Did you just tried outputting? or did you write it to a file and then tried openning? If so, are you sure the output device ( text editor, web explorer etc ) has the correct locale to display such data?
Once again, just a friendly reminder, don't use de_DE.utf8 or de_DE.UTF-8, just de_DE
Re: German Umlaute2007-06-20T13:50:52Z in response to SystemAdminOkay, back at my workplace...
- locale -a |grep de_DE
Setting the LANG explicitly with (# export LANG="de_DE") doesn´t change anything.
I am outputting the fetched data with print($Bezeichnung."\n");
The string will be displayed up to the umlaut correctly, then it becomes elvish:
"TL StraC;LC9`j 2$p¬2<FAME=H=."
It should be "TL Straßburg".
I use the SSH Tectia Client to connect to the Linux server.
Re: German Umlaute2007-07-04T07:15:24Z in response to HostI looked up the available conversion tables in /opt/ibm/iSeriesAccess/conv_tables and I am missing the files 011104b8.tbl (iSeries ==> Linux) and 04b80111.tbl (Linux ==> iSeries).
The cwbnltbl utility obviously doesnt work, so can I download those two files directly from somewhere?
Re: German Umlaute2007-07-05T15:34:15Z in response to HostAs I noted in a previous post, converting data is not necessary straightforward, so not having that conversion tables do not mean is not working. cwbnltbl will tell you if you need such a table or not.
Can you upload here ODBC trace sql.log ?
To learn how to enable sql.log check this
Re: German Umlaute2007-07-06T08:52:21Z in response to SystemAdmin
- /opt/ibm/iSeriesAccess/bin/cwbnltbl 273 1208
cwbnltbl - Download conversion table utility
Using system: AS-SCHARR
Support for conversions from 273 to 1208 ready.
Doesnt change anything.
AttachmentsUpdated on 2007-07-06T08:52:21Z at 2007-07-06T08:52:21Z by Host
Re: German Umlaute2007-07-06T15:31:52Z in response to Host
As stated before, the product uses BOTH conversion tables AND iConv for character conversions. Current ALL unicode conversions are forced to go through iConv, therefore the cwbnltbl function is working perfectly when stating that the conversion to unicode is working (as its just verifying that iConv can handle it.)