commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: [LANG] How to escape JSON data
Date Thu, 11 Apr 2013 10:56:42 GMT
Hi Christian,
according with json spec [1], you should also escape solidus char
(slash for friends :) ) (even if there are many other libraries which
ignore it).

Anyway, have you already taken a look at LANG-797 [2]

PS: This discussion should be moved to the Dev List.

[1] http://goo.gl/EXRqX
[2] https://issues.apache.org/jira/browse/LANG-797

On 11 April 2013 12:40, Christian Grobmeier <grobmeier@gmail.com> wrote:
> private void encodeString(String string, StringBuilder result, JSON
> annotation) {
>     if(string == null) {
>             result.append(NULL);
>         } else {
>         result.append(QUOTE);
>          result.append(StringEscapeUtils.escapeJava(string));
>          result.append(QUOTE);
>         }
>     }
Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara

Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message