[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Apache cfg for JSON



Stefan,

Personally, the setup I use is like this:

DefaultFsCCSID 37
DefaultNetCCSID 1208
CgiConvMode %%MIXED/MIXED%%

This tells Apache that my local system is CCSID 37 for EBCDIC (you might want 278 for Sweden, I don't remember) and that the network should be CCSID 1208 (UTF-8).  This will cause Apache to translate the data from UTF-8 to EBCDIC when receiving, or from EBCDIC to UTF-8 when sending.

If you leave off the DefaultNetCCSID, it will use CCSID 819, I believe -- and that's not Unicode, it's ASCII.

The other thing I've noticed is that if you use 'text/xml' it will translate it, but 'application/xml' will not.  It seems to differentiate between text documents vs. non-text -- and since XML is text, but has 'application' it causes problems.  Same for 'application/json'.  Therefore, you may need to read into a CCSID(*UTF8) field in your RPG program, and convert it yourself.  Depending on the circumstances.

If you are using YAJLINTO, consider telling it to read the input for you by specifying *STDIN as the document.

DATA-INTO myDS %DATA('*STDIN') %PARSER('YAJLINTO')

It has some sophisticated routines to properly figure out the encoding of the data and translate it properly so that it gets parsed correctly.  If you want to call QtmhRdStin manually, you certainly can do that, but you'll have to figure out the encoding, too.
-- 
Scott Klement
sk@xxxxxxxxxxxxxxxx
On 12/10/2020 4:08 PM, stefan@xxxxxxxxxx wrote:

Rainer and Brad,

 

Thanks a lot!

I have it working now – I do not fully understand why yet – but this is a big step forward.

I guess I tried to complicate things ……

 

All the best,

 

Best regards

 

Stefan

 

--

 

Stefan Tageson

+46 732 369934

stefan@xxxxxxxxxx

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Brad Stone
Sent: Thursday, December 10, 2020 9:39 PM
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] Apache cfg for JSON

 

Nope.. use

 

   CGIConvMode %%EBCDIC/EBCDIC%%

 

I don't use DefaultNetCCSID  either.  Works fine.  EBCDIC to ASCII is done internally.

 

On Thu, Dec 10, 2020 at 1:21 PM <stefan@xxxxxxxxxx> wrote:

Hi!

 

Trying to configure a new Apache instance at V7.4 for retrieving json-documents using Yajl.

As json is UTF-8 I thought that :

DefaultNetCCSID 1208  would be a good starting point.

As yajl is expecting data in utf-8 my  next assumption was that:

CGIConvMode %%BINARY/BINARY%% may fit in as this means no conversion.

 

Bad thing is – I’m only getting garbage when looking at the output from  QtmhRdStin.

 

Anyone having a working setup or can push me in the right direction?

 

Big thanks in advance,

 

Stefan

 


Stefan Tageson

 

 

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi