Does Host Bridge Java script support Arabic language Curly braces?
search cancel

Does Host Bridge Java script support Arabic language Curly braces?

book

Article ID: 268243

calendar_today

Updated On:

Products

HB.js

Issue/Introduction

When trying to pass a post body in json it is not reading the curly braces properly. Does Host Bridge Java script support Arabic language Curly braces?

 

Environment

Z/OS

CICS

Resolution

The Arabic EBCDIC codepage doesn't contain curly or square brackets. Host Bridge handles them a bit differently than on a codepage that has them such as 037 English.

Host Bridge has a JSON parser that will parse UTF8, but then convert the values to Arabic.
 
Host Bridge tells CICS to give us the input JSON document in binary (no translation), so that it is in UTF-8.

Then after parsing, you can use the resulting object (variable o) as you normally would and the data values have already been converted to Arabic EBCDIC. 

At the top of the script you will need the following

HB.engine.install"HBR$DAKU" );

That installs the Arabic Kuwait Utilities which contains the UTF8 JSON parser which the script fragment below uses.

 var co = {};
    var cics = new HB.Cics();
    cics.exec.webReceiveBinaryco );    
    var input_utf8 = co.into;    
    //writeln( "Input Dump" );
    //writeln( dbg.toHexDump( input_utf8 ) );    
    var json = new HB.JsonUtf8();    
    try
    {
        var o = json.parseinput_utf8 );
    } 
    catch ( e )
   {
        writeln"JSON Parse EXCEPTION "e );
    }