Link to home
Start Free TrialLog in
Avatar of Theo Kouwenhoven
Theo KouwenhovenFlag for Netherlands

asked on

CCSID issue in LIBHTTP

Hi Experts,


While using (Scottt's) LIBHTTP, i have a CCSID issue (I think).

In de response from "http_string" and in te result file from "http_stmf" I receive

“<currencySymbol>â ¬</currencySymbol>” nstead of “<currencySymbol>€</currencySymbol>”


How to solve this?

Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Hard to say what's going on without seeing the code.  Certainly looks like a CCSID issue to me.  Most web services return data encoded as UTF-8.  


Make sure the CCSID of http_stmf is 1208, and that you're getting unconverted data.


What's the CCSID on the http_stmf, and how are you handling the conversion?  Also what's the CCSID of http_string - it should probably be CCSID(*UTF8).


Code fragment would really help.


Also confirm the web service is actually returning UTF8, of course.

Hi!

Check the response from the server includes the correct content type header. The content type should specify the character encoding used in the response body. If it's missing or incorrect, the client will interpret the data incorrectly.
Avatar of Theo Kouwenhoven

ASKER

Hi Gary, Noah,


The CCSID of the inputfile is 1208 and the outputfile is 819, Even when I create that file first with CCSID 1208.
I have no idea where to define the CCSID for the output.


I already changed :

http_stmf('POST':URL:XMLUIT:XMLIN:'text/xml');

into: http_stmf('POST':URL:XMLUIT:XMLIN:'text/xml;charset=UTF-8');

and added: http_setOption('Content-Type': 'text/xml;charset=UTF-8');


No effect on the result

ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How about overriding the CCSID of the output file?

OVRDBF FILE(outputfile) TOFILE(lib/outputfile) CCSID(819)

Open in new window

The  http_setOption('file-ccsid':'1208') did the trick  :-)

THANKS!!!!!