YAJLINTO parsing error
Posted: Wed Sep 14, 2022 2:20 pm
I am using HTTP_POST_VERBOSE to retrieve product data from an external web service. The data returned contains a trademark symbol that is causing an error when parsing the json response data using YAJLINTO.
1002: lexical error: invalid character inside string.█
The value is "Name": "Gildan® Heavy Cotton™ T-Shirt", but that is not what displays in the debug view. There is a "?" where the trademark should be.
I am almost certain that the actual issue is the encoding of the response data, but I have yet to find a CCSID value that results in data that can be parsed correctly. I would rather not scan and replace characters in the response data if I can avoid it.
Dcl-s wsResponseCLOB SQLTYPE(CLOB:500000);
I have tried specifying CCSID 1252, 1208, 819, and some other random values I found online. The CLOB variable shows the unrecognized character. That field gets moved to a varchar field that is returned to the requestor for parsing. I have tried manipulating the character set in the calling program as well without any success.
Is there a way around this? What am I missing?
1002: lexical error: invalid character inside string.█
The value is "Name": "Gildan® Heavy Cotton™ T-Shirt", but that is not what displays in the debug view. There is a "?" where the trademark should be.
I am almost certain that the actual issue is the encoding of the response data, but I have yet to find a CCSID value that results in data that can be parsed correctly. I would rather not scan and replace characters in the response data if I can avoid it.
Dcl-s wsResponseCLOB SQLTYPE(CLOB:500000);
I have tried specifying CCSID 1252, 1208, 819, and some other random values I found online. The CLOB variable shows the unrecognized character. That field gets moved to a varchar field that is returned to the requestor for parsing. I have tried manipulating the character set in the calling program as well without any success.
Is there a way around this? What am I missing?