how to encode and decode Json in J2ME?
Encoding it you can easily do manually, but for encoding and decoding here is a tutorial to help you.
http://jimmod.com/blog/2010/03/java-me-j2me-json-implementation-tutorialsample/
Related
I'm working with effectively a JSON API, that requires the JSON payload to be base64 encoded.
I can't imagine a good reason for encoding JSON as base64, it should be already safely utf8 encoded as valid JSON, so am I missing something?
Perhaps it's used as a way to serialise / compare the JSON, but I'm assuming that canonicalisation / comparison of JSON surely is a solved problem?
I was expecting a JSON string while testing an API using Postman, but instead got this:
{city=Shanghai, work=112-454-7895, fax=788-899-7899}
Obviously I cannot put that into Google and ask what format is it, hence I am asking it here. Postman also says it is a 'bad string'.
I have never seen the above data serialization format. If someone can point the format out to me I would be able to find and use a converter. Additional suggestion with converting it to POJO or JSON are welcome as well.
I figured out that the above format is a stringified version of a HashMap<String, String>, and that there is no direct way to convert it into JSON/POJO. Converting it into json string requires additional work but is fairly straightforward.
Does anyone know how to translate JSON into English/Chinese?
I have a JSON64 file that I want to decode in order to retrieve the information in there.
Thanks
I have JSON response from server, but I don't how to decode it and read.
{"data":"hX8L^^\u0002#[ZUN\\r[\\A\\6V\u0017\fq\u0012\u0004P^U_\u0016\u0005\u0006\u0017\u0000'FWPM\u0003LZ\u0010gHsF\u000e\u0012UE\u0012\t\u000fM#:\u0003A~VKb\u0015\u001dO\u0014\u0012\u0006pQ\u0005\u0005\u0010\u000b\u0001\u001d/\u0000A\u0014ke\u0015Y\u0004l|#K&\t\u0017uqJ>`r\fBK)Yf\u0015ZO\u000bfG'MO\b_mob\n\u0004KyQO\tRkuYJcZ\u0016uBb|dt\u0012Xt\f\u0006H\u001cz\u00162\u0003T\u001eWJ4azw\u001dR\u00104WZ\u0001w\u0013\u0000lbS#!#\u00055#Q'X\u0005-N##\u0010\\+D\u0005\u0003\u0018h+JL..Dk\u0005\u000bre\r\u0013YK&]R7\u0010k\u0016e\u0013q\u0003\u0015\n\u0002\u0012p\u0002\u0016$&#...
is there any converter?
thx
There are some things around the web but it's hard to tell what the standard is.
I need to do encoding and decoding. So JSON string -> AS object and AS object -> JSON string.
AFAIK, this is the standard: http://code.google.com/p/as3corelib/.
So, for instance, you can use JSON.decode(s) and JSON.encode(o) to go from string-to-object and object-to-string. I've never had a problem, except that you should wrap it in try/catch during decode because it can throw errors when the JSON is invalid.