PDA

View Full Version : [PENDING] JSON encde problem


sasuolin
07-08-2010, 10:56 AM
hello,

Ii have JSON encode problem when i'm traying to use hebrew characters with double qoute.

I have jot this message :

{"SUCCESS":"1","CUSNO":1,"CNAME":"ENGLISH + כולל ספרות 123 נסיון עברית","CADDR1":"10 פרג","CADDR2":"","CCITY":"ר"\ג","CSTATE":"IL","CCOUNTRY":"","CZIP":"81544","CYTDSALES":0,"CLASTACT":"1901-01-01"}


illegal character
[Break on this error] ({"SUCCESS":"1","CUSNO":1,"CNAME":"ENG...CYTDSALES":0,"CLASTACT":"1901-01-01"})

any idia how to solve this problem.

thanks

richard.milone
07-12-2010, 09:36 AM
Can you post the RPG code that generates the JSON response? Also, an exact print screen or a more detailed description of the error you're getting would be helpful.

sasuolin
07-14-2010, 10:25 AM
hello,

I'm using the same rpg program in your example EXAPPCM without any changes,
may be the problem is when i use Hebrew character that include double qoute.

richard.milone
07-15-2010, 11:08 AM
There are various ways to format JSON from Valence. If you post up your RPG code that generates the JSON string you put in your first post we will let you know what to change in that code to get it to work.

sasuolin
07-18-2010, 02:03 AM
here is my rpg source:

" SRCSEQ SRCSEQ"," SRCDAT SRCDAT"," SRCDTA SRCDTA"
1.0,0," /copy qcpylesrc,vvHspec"
2.0,0," ** --------------------------------------------------------------"
3.0,0," ** Copyright (C) 2008-2010 CNX Corporation"
4.0,0," ** --------------------------------------------------------------"
5.0,0," ** Object ID: EXFORM"
6.0,0," ** Version: V2.1"
7.0,0," ** Description: Valence Examples - Forms - Simple/Complex Form"
8.0,0," ** --------------------------------------------------------------"
9.0,0," fdemocmast if e k disk"
10.0,0," **--------------------------------------------"
11.0,0," ** d specs"
12.0,0," **--------------------------------------------"
13.0,0," ** internal procedures..."
14.0,0," d SendCustRec pr"
15.0,0," /copy qcpylesrc,vvDspec"
16.0,0," **--------------------------------------------"
17.0,0," ** program start"
18.0,0," **--------------------------------------------"
19.0,0," /free"
20.0,0," SendCustRec();"
21.0,0," *inlr=TRUE;"
22.0,0," /end-free"
23.0,0," **--------------------------------------------"
24.0,0," p SendCustRec b"
25.0,0,""
26.0,0," d SendCustRec pi"
27.0,0,""
28.0,0," d cusRecord ds likerec(cmast) inz"
29.0,0," d Xcusno s 6 0"
30.0,0," /free"
31.0,0,""
32.0,0," // - retrieve the value of Xcusno as sent in by the browser"
33.0,0," // - chain to the file and move the result in a data structure"
34.0,0," // - specify the name of the object/file, the vvOut_toJSON"
35.0,0," // procedure will use this information to parse the data"
36.0,0," // and send it back to the browser..."
37.0,0," //"
38.0,0," Xcusno = vvIn_num('xcusno');"
39.0,0,""
40.0,0," chain(n) Xcusno democmast cusRecord;"
41.0,0," if %found(democmast);"
42.0,0," vvOut.object = 'DEMOCMAST';"
43.0,0," vvOut.success = 'Y';"
44.0,0," vvOut_toJSON(vvOut:%addr(cusRecord));"
45.0,0," else;"
46.0,0," vvOut_toJSONpair('SUCCESS:0,MSGTEXT:Invalid Customer');"
47.0,0," endif;"
48.0,0," /end-free"
49.0,0," p e"

sasuolin
07-22-2010, 03:07 AM
Hello,

I sent the rpg code and i'm waiting to know houe to format the json
to solve this problem.

sasuolin
09-12-2010, 12:10 PM
hello,

There is any news about json incode problem ?

richard.milone
09-14-2010, 10:33 PM
Hi sasuolin, we would like to talk with you in an online meeting so we can debug this on your system. If there is a bug we can then include a fix on our next release of Valence. Please email me directly with your contact information and hours of availability this week. See email address below.

richard.milone
09-28-2010, 01:51 PM
Hi sasuolin, so far we cannot find an issue with this on our end. If you have time, please contact support so that we can work with you to identify if there is a problem. You may need to check your CCSID that the Apache server is running under so that it can handle Hebrew characters, or you can use Unicode fields. There are several examples for doing this included with Valence. Until you contact us I will just mark this thread as PENDING.