Page 1 of 1

Using CCSID 1208 - accent characters

Posted: Thu Apr 06, 2023 5:56 pm
by glenhart
Hi,

I am totally stuck. I know there have been discussions on this, but in most cases, it relates to importing the json from a web service.

I am importing the JSON file from the IFS using yajl_stmf_load_tree(IFSFILE : errMsg); This file holds an accent character in the data portion.

When I run e1Sfcd = yajl_get_string(node); the results do not correctly translate the accent character. It becomes an unprintable character.

I have where some have used http_setOption ( 'network-ccsid' : '1208' ); Which I tried to set as the first step I m my program, but that did not resolve the issue.

Any help at all.. I am desperate for a solution.

Many thanks
Glen.

Re: Using CCSID 1208 - accent characters

Posted: Mon Apr 10, 2023 9:39 pm
by Scott Klement
http_setOption is for setting options in HTTPAPI - it has nothing whatsoever to do with YAJL.

You will need to troubleshoot what's happening.
  • Use the WRKLNK command to see what the CCSID on your JSON file is.
  • Use DSPF and F10=Display Hex to see the hex value of the accented character.
  • Look on a table and verify that it is the correct hex value for that character under that particular CCSID.
  • Debug YAJLR4, the yajl_stmf_load_tree routine should be reading the data so that it will translate to UTF-8 (CCSID 1208). Look at what it has read in the debugger, view it in hex... verify that it has the correct hex value for the accented character in UTF-8.
  • The output from yajl_get_string() is in the job's CCSID. Look at your job CCSID, and the hex value of the character as output from yajl_get_string and see if it is correct for your job ccsid.
If all of this is correct, then the problem isn't YAJL.

If it's failing at some point, then what point? What is the hex value reported? What CCSID is it supposed to be? What is the correct hex value for that CCSID?

Re: Using CCSID 1208 - accent characters

Posted: Sat Apr 22, 2023 3:56 pm
by glenhart
Thank you so much for providing me with direction.. I will go through the checklist and later post my findings for others that may have the same issue.
Dealing with CCSID is new for me.

Re: Using CCSID 1208 - accent characters

Posted: Wed May 10, 2023 5:51 pm
by glenhart
Hi,

The issue was that the file CCSID was 437.
For it to work with a French accent I needed it to be UTF-8 (CCSID 1208)

To achieve this I ran the following command on the file before I imported:
CPY OBJ('/home/tfr_t/sfc/in/product_202325140925.json') TOOBJ('/home/tfr_t/sfc/in/product_202325140925.json') TOCCSID(1208) REPLACE(*YES)

Then doing a YAML import from the IFS worked correct..
Thanks for your guidance.