Giter Site home page Giter Site logo

Comments (5)

jimoibm avatar jimoibm commented on May 30, 2024

Can you please show me more details on what the result/error was? Was the URI chars were escaped in the browser? Was the job calling XMLService in the job ccsid as you expected? What ccids was your cmd/pgm expecting for chars encoded with?

from xmlservice.

owen-rpx avatar owen-rpx commented on May 30, 2024

@jimoibm @kadler
I need to run cmd and store the china chars into DB2.
Below is cmd results:

<?xml version="1.0"?> <xmlservice> <cmd><success><![CDATA[+++ success CHGLIBL LIBL(QGPL QTEMP)]]></success> </cmd> <cmd exec='rexx'><success><![CDATA[+++ success CMD1 SSNID(1i6cvqpz0ce84ws040gc8wsg4) USR(USE) PAE(''A002'') RTNMSG(?) TSKTXT(''皜祈岫'')]]></success> <row> <data desc='RTNMSG'><![CDATA[ Task A002 already exists. Cannot add.]]></data> </row> </cmd> </xmlservice>

I try encode at my nodejs code but now working.
Big5 is charset

from xmlservice.

jimoibm avatar jimoibm commented on May 30, 2024

Are you saying it is working now?

  • If yes, is anything else expected from us to look at? are you indicating errrors in nodejs?
  • If no,
    Did you use HTTP server or nodejs?
    Looks like CMD1 is a placeholder for your own object? Did you check the ccsid/encoding from there?

from xmlservice.

owen-rpx avatar owen-rpx commented on May 30, 2024

Not working,
I use Postman to debug it and Post method url is http://xxx.xxxx.com:portNum/cgi-bin/xmlcgi.pgm
The CMD1 is placeholder, yes.
I try to use hex='on' as below:
<?xml version="1.0"?> <xmlservice> <cmd>CHGLIBL LIBL(ACMSALIB QGPL QTEMP)</cmd> <cmd exec='rexx' hex='on' before='937/37'>CMD1 SSNID(1i6cvqpz0ce84ws040gc8wsg4) USR(XUDONGZ) PAE(''A002'') RTNMSG(?) TSKTXT(''測試'')</cmd> </xmlservice>

My web page show missing codes:
image

OR give us some example for ccsid convert
https://xmlservice.readthedocs.io/en/latest/functions.html?highlight=hex#advanced-ccsid
bin2hex('China_ascii_raw_chars')
I see the above docs but not get clear solution for CMD/PGM

from xmlservice.

jimoibm avatar jimoibm commented on May 30, 2024

hex='on' means you need to give hexadecimal....
before/after='fromCCSID/toCCSID' you need consider well on your job ccsid/parm ccsid pgm taking in

if using command call, you need to HEX'd all the command string..
You may consider using pgm call for better control of ccsid conversion on the only needed parms

If hit error complaining Argument list too long., it is caused by a bug below if receiver needs to be bigger than input for iconv(). Try using hex without conversion and workaround in your code..

size = anyBIG(index).bigsize; <-- should be bigger for receiver

rc = iconv(conv.conv
          :%addr(fromPtr):%addr(fromBytes)
          :%addr(toPtr):%addr(toBytes));  <-- toBytes should greater than fromBytes

Possible one spot change:

     P cacAddBig       B                   export
     D cacAddBig       PI            10i 0
     D  bsize                        10i 0 value
     D  btype                         1A   value
     ...
       /free
         bsize = bsize * 4;  <--- make a bigger receiver size...
     ....

Command call example:

CHGLIB LIB(JIMOCN) TEXT('中')
935 -> 1208                                                             
hex ->  IN: C3C8C7D3C9C240D3C9C24DD1C9D4D6C3D55D40E3C5E7E34D7D0E5BCF0F7D5D404040404040404040                                        
hex -> OUT: 4348474C4942204C4942284A494D4F434E2920544558542827E4B8AD2729202020202020202020

&ipc=*NA&ctl="*here"&xmlin="<?xml version='1.0'?><cmd hex='on' before='1208/935' after='935/1208'>4348474C4942204C4942284A494D4F434E2920544558542827E4B8AD2729202020202020202020</cmd>"&xmlout=500000

Result:

<?xml version='1.0'?><cmd hex='on' before='1208/935' after='935/1208'><success>+++ success CHGLIB LIB(JIMOCN) TEXT('�$õ�')</success>
</cmd>

from xmlservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.