You can set the ccsid for an variable. //control option
ctl-opt option(*nodebugio:*srcstmt) CCSID(*CHAR:37) CCSID(*UCS2:1200)
CCSIDCVT(*EXCP)
CCSID(*EXACT)
dftactgrp(*no) ;
//variables
dcl-s ToBeEncoded Varchar(100) Inz('') CCSID(1208);
dcl-s name varchar(20) ccsid(*jobrun);
dcl-s temp_name varucs2(20); dcl-s stringA char(10000) ccsid(*utf8);
dcl-pr getData varchar(10000) ccsid(*utf8);
//data structures
dcl-ds ds1 likerec(rec) ccsid(*exact);
dcl-ds ds2 extname('MYFILE') ccsid(*exact);
set ccsid(*char : *JOBRUN) ;
restore ccsid(*char) ;
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx]
On Behalf Of la Croix, Richard Hello all, I am having a problem with utf-8 data received using the new http_string procedure. When I use http_stmf() I can first set the ccsid for the output file to 1208 (using http_setOption('file-ccsid': '1208')), as JSON data should always be utf-8 (ccsid 1208). I can then process the file with yajl_stmf_load_tree() and the utf-8 strings are converted correctly. I would like to skip the detour via the ifs and directly process the string as received using the http_string() procedure. However when I pass the output from http_string() to yajl_buf_load_tree() the JSON fields
containing utf-8 data come out wrong (e.g. ‘Randonnée’ vs. ‘Randonnée’). As far as I can see, there is no equivalent to setting http_setOption('file-ccsid': '1208') for directly receiving utf-8 data into a variable. Am I missing something? Any ideas? Best regards, Richard
|
-- _______________________________________________ Ftpapi mailing list Ftpapi@xxxxxxxxxxxxxxxxxxxxxx http://scottklement.com/mailman/listinfo/ftpapi