QCMDEXC and unicode

Use this board for starting discussions, asking questions, and giving advice on RPG programming for the IBM i platform (and predecessors.)
Paul
Profound User
Posts: 39
Joined: Mon Aug 29, 2011 10:53 pm
First Name: Paul
Last Name: Foster
Company Name: GRI Group Ltd
Country: Hong Kong
Location: Hong Kong
Contact:

QCMDEXC and unicode

Post by Paul »

We have a number of PHP scripts called from RPGLE using QCMDEXC, passing parameters that PHP reads through the $_SERVER array. We use this when something is difficult to do in RPG, (e.g. json_decode). All works great, but now we have a requirement to pass unicode characters as parameters (e.g. Chinese). QCMDEXC is not happy about this, I suppose as its command string is defined as type "a".

Does anyone know a way of calling a PHP script from RPGLE passing a non-EBCDIC parameter? A work-around could be to send the parameters as an IFS file and then open and read this in the PHP. This would add extra overhead and would be messy as the files would need to be created/destroyed etc. If anyone knows a more graceful method it would be much appreciated.

Paul
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: QCMDEXC and unicode

Post by Scott Klement »

Maybe you create a hex dump of the parameter data, pass that to the PHP script, and have the PHP script convert them back to Unicode? It would require some extra programming, obviously... but should allow all data to be passed.

I haven't tried it, myself, but it seems like it should work.
Paul
Profound User
Posts: 39
Joined: Mon Aug 29, 2011 10:53 pm
First Name: Paul
Last Name: Foster
Company Name: GRI Group Ltd
Country: Hong Kong
Location: Hong Kong
Contact:

Re: QCMDEXC and unicode

Post by Paul »

Thanks Scott, good idea, I think that would work. We had already started the temp file solution with the parameters being json pairs in the temp file, and it's working well. I'll give the hex conversion a go though.

Thanks,

Paul
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests