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.
Using CCSID 1208 - accent characters
-
- Site Admin
- Posts: 884
- Joined: Sun Jul 04, 2021 5:12 am
Re: Using CCSID 1208 - accent characters
http_setOption is for setting options in HTTPAPI - it has nothing whatsoever to do with YAJL.
You will need to troubleshoot what's happening.
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?
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 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
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.
Dealing with CCSID is new for me.
Re: Using CCSID 1208 - accent characters
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.
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.
-
- Posts: 1
- Joined: Wed Jul 02, 2025 8:01 pm
Re: Using CCSID 1208 - accent characters
I realize this is an old post but I am having a similar issue but on an http_req. I thought after reading this that I found the issue but sadly it did not solve my problem. Our problem is similar with accented characters in a person's name.
For example, ñ
When we make the http_req, we get a bad request. The API host is telling us that it should be encoded properly.
We are using yajl and from what I am reading the yajl procedures are converting everything to UTF-8. But when I was reviewing code, I noticed that they used 0 as the CCSID parameter on the
So I figured it was using my job's CCSID of 37.
I attempted to change to 1208. But that was a complete failure.
Any help would be appreciated. I could start a new post too if necessary.
NOTE: if I replace the ntilde, with just an "n". the call goes through without issue.
For example, ñ
When we make the http_req, we get a bad request. The API host is telling us that it should be encoded properly.
We are using yajl and from what I am reading the yajl procedures are converting everything to UTF-8. But when I was reviewing code, I noticed that they used 0 as the CCSID parameter on the
Code: Select all
yajl_copyBuf(0:x_stream:10000:retsize);
I attempted to change to 1208. But that was a complete failure.
Any help would be appreciated. I could start a new post too if necessary.
Code: Select all
yajl_copyBuf(0:x_stream:10000:retsize);
monitor;
clear xmlret;
RQ = http_req('POST'
: URL
: *OMIT
: xmlret
: *OMIT
: %trim(xstream)
: 'application/json');