Hello:
I have been using YAJL for many time with good results.
The problem is that we have now a new project for Russia, and we must send and seceive cyrillic characters.
For example, we have to send a JSON document like this:
{
.....
"Items": [
{
"Label": "Это тест",
"Price": 1.00,
"Quantity": 1,
"Amount": 1.00,
"Vat": "Vat10"
}
]
.....
}
In the "Label" we have to send a russian text.
We have the data in russian in a PF FILE like this:
...
A LABEL 65G COLHDG('Label')
A CCSID(1200 *NOCONVERT)
...
And we are using YAJL, this way:
// ..............
yajl_beginArray('Items');
setll tc_codigo rtetickd;
dou %eof(TE_TICK_D);
reade tc_codigo rtetickd;
if not %eof;
yajl_beginobj();
yajl_addchar('Label':%char(tcd_label)); // !!!!!
yajl_addnum('Price':%char(tcd_price));
yajl_addnum('Quantity':%char(tcd_quantity));
yajl_addnum('Amount':%char(tcd_amount));
yajl_addchar('Vat':%trim(tcd_vat));
yajl_endobj();
endif;
enddo;
// .................
What am I doing wrong? I have tried with yajl_addcharptr also, with the same results. The only way it works is with yajl_addcharstmf.
Thanks in advance.
Christian Larsen
I have been using YAJL for many time with good results.
The problem is that we have now a new project for Russia, and we must send and seceive cyrillic characters.
For example, we have to send a JSON document like this:
{
.....
"Items": [
{
"Label": "Это тест",
"Price": 1.00,
"Quantity": 1,
"Amount": 1.00,
"Vat": "Vat10"
}
]
.....
}
In the "Label" we have to send a russian text.
We have the data in russian in a PF FILE like this:
...
A LABEL 65G COLHDG('Label')
A CCSID(1200 *NOCONVERT)
...
And we are using YAJL, this way:
// ..............
yajl_beginArray('Items');
setll tc_codigo rtetickd;
dou %eof(TE_TICK_D);
reade tc_codigo rtetickd;
if not %eof;
yajl_beginobj();
yajl_addchar('Label':%char(tcd_label)); // !!!!!
yajl_addnum('Price':%char(tcd_price));
yajl_addnum('Quantity':%char(tcd_quantity));
yajl_addnum('Amount':%char(tcd_amount));
yajl_addchar('Vat':%trim(tcd_vat));
yajl_endobj();
endif;
enddo;
// .................
What am I doing wrong? I have tried with yajl_addcharptr also, with the same results. The only way it works is with yajl_addcharstmf.
Thanks in advance.
Christian Larsen
Comment