I have a simple program to read data from a json file into progress temp-tables. Program works well most of the time, but I am running into some data that causes an error as follows
'Unable to convert JSON to native data type for field 'name' in temp-table 'ttregions'. (15363)
Sample data causing this error is below
According to the vendor that supplied the json files the error has to do with unicode encoding and the style they use to generate the data confirms to RFC 4627 JSON specification.
My program is very basic and looks as follows
Any recommendations on how to work with these characters?
'Unable to convert JSON to native data type for field 'name' in temp-table 'ttregions'. (15363)
Sample data causing this error is below
Code:
{
"code": "11b5",
"country": "sk",
"kind": "province",
"name": "Ko\u0161ick\u00fd kraj",
"created_at": "2014-12-08T06:00:00Z",
"updated_at": "2014-12-08T06:00:00Z"
},
According to the vendor that supplied the json files the error has to do with unicode encoding and the style they use to generate the data confirms to RFC 4627 JSON specification.
My program is very basic and looks as follows
Code:
define temp-table ttregions
field code as character
field country as character
field kind as character
field name as character
field created_at as datetime-tz
field updated_at as datetime-tz.
DEFINE VARIABLE cSourceType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE cReadMode AS CHARACTER NO-UNDO.
DEFINE VARIABLE lRetOK AS LOGICAL NO-UNDO.
DEFINE VARIABLE httHPROregions AS HANDLE NO-UNDO.
httHPROregions = temp-table ttHPROregions:handle.
ASSIGN cSourceType = "file"
cFile = "c:\json\regions-0.json"
cReadMode = "empty".
lRetOK = httHPROregions:read-json(cSourceType, cFile, cReadMode).
Any recommendations on how to work with these characters?
Last edited by a moderator: