You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Maurizio Cucchiara <mc...@apache.org> on 2013/04/09 12:51:23 UTC

[LANG] How to escape JSON data

Hi guys,
what is the best way to escape json data?

We (the Struts team) have been experiencing an issue [1] with the ECMA
Script translator (which, at first glance, could seem the right one).

It turned out that the Java translator which best fits to JSON, but I
don't think it's a good solution to use a translator designed for
other needs.

Should we define a custom translator?

[1] https://issues.apache.org/jira/browse/WW-4041


Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara

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


RE: [LANG] How to escape JSON data

Posted by Martin Gainty <mg...@hotmail.com>.
so in other words if the following Text is inputted by JQuery to JSON Parser
 
Martin O'Sullivan sends XYZ to Maurizio D'Milano 

The JQuery-JSON Parse could possibly encode the tickmark embedded in the sirnames incorrectly
 
what if we frontend all calls to JQuery.parse with a Json_Encoder which would encode 

Martin O'Sullivan sends XYZ to the Maurizio D'Milano 

as

Martin O\u0027Sullivan sends XYZ  to Maurizio D\u0027Milano

conversely returning from JSON Parse the Json_Decoder would decode 

Martin O\u0027Sullivan sends XYZ  to Maurizio D\u0027Milano

as
Martin O'Sullivan sends XYZ to Maurizio D'Milano 

?
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

  


> From: mcucchiara@apache.org
> Date: Wed, 10 Apr 2013 11:37:44 +0200
> Subject: Re: [LANG] How to escape JSON data
> To: user@commons.apache.org
> 
> Actually, when I was talking about the best way, I was asking for a
> "common" way.
> 
> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
> > I might suggest looking into the json.org library.
> >
> >
> > On 4/9/13 7:36 AM, Maurizio Cucchiara wrote:
> >>
> >> OK,
> >> there is already an opened issue [1]
> >>
> >> [1] https://issues.apache.org/jira/browse/LANG-797
> >>
> >> 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
> >>
> >>
> >> On 9 April 2013 12:51, Maurizio Cucchiara <mc...@apache.org> wrote:
> >>>
> >>> Hi guys,
> >>> what is the best way to escape json data?
> >>>
> >>> We (the Struts team) have been experiencing an issue [1] with the ECMA
> >>> Script translator (which, at first glance, could seem the right one).
> >>>
> >>> It turned out that the Java translator which best fits to JSON, but I
> >>> don't think it's a good solution to use a translator designed for
> >>> other needs.
> >>>
> >>> Should we define a custom translator?
> >>>
> >>> [1] https://issues.apache.org/jira/browse/WW-4041
> >>>
> >>>
> >>> Twitter :http://www.twitter.com/m_cucchiara
> >>> G+ :https://plus.google.com/107903711540963855921
> >>> Linkedin :http://www.linkedin.com/in/mauriziocucchiara
> >>>
> >>> Maurizio Cucchiara
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  

Re: [LANG] How to escape JSON data

Posted by Raja Pothunuri <ra...@yahoo.com>.

Raja Pothunuri

On Apr 10, 2013, at 2:37 AM, Maurizio Cucchiara <mc...@apache.org> wrote:

> Actually, when I was talking about the best way, I was asking for a
> "common" way.
> 
> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
>> I might suggest looking into the json.org library.
>> 
>> 
>> On 4/9/13 7:36 AM, Maurizio Cucchiara wrote:
>>> 
>>> OK,
>>> there is already an opened issue [1]
>>> 
>>> [1] https://issues.apache.org/jira/browse/LANG-797
>>> 
>>> 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
>>> 
>>> 
>>> On 9 April 2013 12:51, Maurizio Cucchiara <mc...@apache.org> wrote:
>>>> 
>>>> Hi guys,
>>>> what is the best way to escape json data?
>>>> 
>>>> We (the Struts team) have been experiencing an issue [1] with the ECMA
>>>> Script translator (which, at first glance, could seem the right one).
>>>> 
>>>> It turned out that the Java translator which best fits to JSON, but I
>>>> don't think it's a good solution to use a translator designed for
>>>> other needs.
>>>> 
>>>> Should we define a custom translator?
>>>> 
>>>> [1] https://issues.apache.org/jira/browse/WW-4041
>>>> 
>>>> 
>>>> Twitter     :http://www.twitter.com/m_cucchiara
>>>> G+          :https://plus.google.com/107903711540963855921
>>>> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>>>> 
>>>> Maurizio Cucchiara
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

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


Re: [LANG] How to escape JSON data

Posted by Greg Thomas <gr...@gmail.com>.
>  I don't know off the top of my head what license json.org uses.

It's a "Do no evil" licence - unless you're IBM or one of their minions.

Greg


On 10 April 2013 19:13, Daniel Pitts <co...@gmail.com> wrote:

> Do you mean "a common way" or "the Commons way". json.org is pretty much
> canonical when it comes to JSON encoding. How much more common do you need?
> I realize that this is the apache commons user list, and it wouldn't hurt
> to have Commons support JSON better. However as an pragmatic engineer, I
> would use json.org before asking the apache community to duplicate that
> functionality, unless there are issues with licensing for you. I don't know
> off the top of my head what license json.org uses.
>
> On 4/10/13 2:37 AM, Maurizio Cucchiara wrote:
>
>> Actually, when I was talking about the best way, I was asking for a
>> "common" way.
>>
>> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
>>
>>> I might suggest looking into the json.org library.
>>>
>>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [LANG] How to escape JSON data

Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Apr 11, 2013 at 4:54 PM, Maurizio Cucchiara
<mc...@apache.org> wrote:
>> Anyway, my lib is mainly written for my own use. It seems I have never
>> sent a slash with json, so it didn't pop up.
> Many javascript libraries work smoothly with slashes.

I hear you. Anyway better stick closely to the specs.

>> That said I will move on
>> to escapeJavaScript now, which I actually missed.
> you mean escapeEcmaScript? if yes, beware that it escapes the
> apostrophe, and this will likely harm your app.

OK thanks. I will consider it.

>
>> Looks good at first glance - what prevents you to commit it?
> Lang is not my territory, I have been waiting for other comments.
> Anyway, you are right, I'm going to commit the patch ASAP.

CTR :-)

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



--
http://www.grobmeier.de
https://www.timeandbill.de

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


Re: [LANG] How to escape JSON data

Posted by Maurizio Cucchiara <mc...@apache.org>.
> Anyway, my lib is mainly written for my own use. It seems I have never
> sent a slash with json, so it didn't pop up.
Many javascript libraries work smoothly with slashes.

> That said I will move on
> to escapeJavaScript now, which I actually missed.
you mean escapeEcmaScript? if yes, beware that it escapes the
apostrophe, and this will likely harm your app.

> Looks good at first glance - what prevents you to commit it?
Lang is not my territory, I have been waiting for other comments.
Anyway, you are right, I'm going to commit the patch ASAP.

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


Re: [LANG] How to escape JSON data

Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Apr 11, 2013 at 12:56 PM, Maurizio Cucchiara
<mc...@apache.org> wrote:
> Hi Christian,
> according with json spec [1], you should also escape solidus char
> (slash for friends :) )

thanks for avoiding me look dumb :-)

Anyway, my lib is mainly written for my own use. It seems I have never
sent a slash with json, so it didn't pop up.  That said I will move on
to escapeJavaScript now, which I actually missed.

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

Looks good at first glance - what prevents you to commit it?

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

Indeed. :-)

Cheers
Christian

>
> [1] http://goo.gl/EXRqX
> [2] https://issues.apache.org/jira/browse/LANG-797
>
> On 11 April 2013 12:40, Christian Grobmeier <gr...@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
>



--
http://www.grobmeier.de
https://www.timeandbill.de

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


Re: [LANG] How to escape JSON data

Posted by Maurizio Cucchiara <mc...@apache.org>.
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 <gr...@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


Re: [LANG] How to escape JSON data

Posted by Christian Grobmeier <gr...@gmail.com>.
On Wed, Apr 10, 2013 at 8:41 PM, Maurizio Cucchiara
<mc...@apache.org> wrote:
> There are a lot of reasons which let me think that having inside the
> StringEscapeUtils class is a legitimate idea:
> 1. take a look at SEU's methods [2]
> 2. adding a new dependency, just for json escaping,  seems excessive to me.
> 3. Last but not least there is already an open issue [1], and FYI I
> have already submitted a patch.

I am using StringEscapeUtils for that task in my JSON lib:
https://github.com/grobmeier/jjson/blob/master/jjson/src/main/java/de/grobmeier/jjson/convert/JSONAnnotationEncoder.java

(line 274)

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);
        }
    }

It works pretty well for me. Note, I am using it actually with Struts
2, I created a simple JSON plugin in the same repos.
If its of use, I am willing to contribute everything to whereever it makes sense

Cheers
Christian



>
> [1] https://issues.apache.org/jira/browse/LANG-797
> [2] http://commons.apache.org/proper/commons-lang//apidocs/org/apache/commons/lang3/StringEscapeUtils.html#method_summary
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>



--
http://www.grobmeier.de
https://www.timeandbill.de

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


Re: [LANG] How to escape JSON data

Posted by Maurizio Cucchiara <mc...@apache.org>.
> Do you mean "a common way" or "the Commons way".
Sorry, I meant the second one.

> json.org is pretty much canonical when it comes to JSON encoding. How much more common do you need? I realize that this is the apache commons user list, and it wouldn't hurt to have Commons support JSON better. However as an pragmatic engineer, I would use json.org before asking the apache community to duplicate that functionality

There are a lot of reasons which let me think that having inside the
StringEscapeUtils class is a legitimate idea:
1. take a look at SEU's methods [2]
2. adding a new dependency, just for json escaping,  seems excessive to me.
3. Last but not least there is already an open issue [1], and FYI I
have already submitted a patch.

[1] https://issues.apache.org/jira/browse/LANG-797
[2] http://commons.apache.org/proper/commons-lang//apidocs/org/apache/commons/lang3/StringEscapeUtils.html#method_summary

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


RE: [LANG] How to escape JSON data

Posted by Martin Gainty <mg...@hotmail.com>.
we ran into a problem with single tickmarks in Struts-user with JSON parse method..to wit;
 
var json_parse = (function () {
    "use strict";


// This is a function that can parse a JSON text, producing a JavaScript
// data structure. It is a simple, recursive descent parser. It does not use
// eval or regular expressions, so it can be used as a model for implementing
// a JSON parser in other languages.


// We are defining the function inside of another function to avoid creating
// global variables.


    var at,     // The index of the current character
        ch,     // The current character
        escapee = {
            '"':  '"',
            '\\': '\\',
            '/':  '/',
            b:    '\b',
            f:    '\f',
            n:    '\n',
            r:    '\r',
            t:    '\t'
        },
        text,


        error = function (m) {


https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
 
notice that the code gleefully ignores tickmarks so we need to rewrite..

can someone poke the bear and get crockford to do this or should we enlist Mr Koch?

?
Martin  
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 .

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

  


> Date: Thu, 11 Apr 2013 09:32:10 +0200
> From: ebourg@apache.org
> To: user@commons.apache.org
> Subject: Re: [LANG] How to escape JSON data
> 
> Le 11/04/2013 00:26, Daniel Pitts a écrit :
> > Well, I'd be inclined to use the library written by the same people who
> > maintain the spec: http://www.json.org/java/index.html
> 
> If I'm not mistaken the "shall be used for Good, not Evil" clause is a
> field of use restriction, that's not an open source license.
> 
> http://debian.2.n7.nabble.com/The-Software-shall-be-used-for-Good-not-Evil-td1953402.html
> 
> 
> Emmanuel Bourg
> 
> 
 		 	   		  

Re: [LANG] How to escape JSON data

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 11/04/2013 00:26, Daniel Pitts a écrit :
> Well, I'd be inclined to use the library written by the same people who
> maintain the spec: http://www.json.org/java/index.html

If I'm not mistaken the "shall be used for Good, not Evil" clause is a
field of use restriction, that's not an open source license.

http://debian.2.n7.nabble.com/The-Software-shall-be-used-for-Good-not-Evil-td1953402.html


Emmanuel Bourg



Re: [LANG] How to escape JSON data

Posted by Daniel Pitts <co...@gmail.com>.
Well, I'd be inclined to use the library written by the same people who 
maintain the spec: http://www.json.org/java/index.html

On 4/10/13 11:20 AM, Gary Gregory wrote:
> Note that json.org is a spec, not an implementation.
>
> Gary
>
>
> On Wed, Apr 10, 2013 at 2:13 PM, Daniel Pitts <co...@gmail.com>wrote:
>
>> Do you mean "a common way" or "the Commons way". json.org is pretty much
>> canonical when it comes to JSON encoding. How much more common do you need?
>> I realize that this is the apache commons user list, and it wouldn't hurt
>> to have Commons support JSON better. However as an pragmatic engineer, I
>> would use json.org before asking the apache community to duplicate that
>> functionality, unless there are issues with licensing for you. I don't know
>> off the top of my head what license json.org uses.
>>
>> On 4/10/13 2:37 AM, Maurizio Cucchiara wrote:
>>
>>> Actually, when I was talking about the best way, I was asking for a
>>> "common" way.
>>>
>>> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
>>>
>>>> I might suggest looking into the json.org library.
>>>>
>>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>


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


Re: [LANG] How to escape JSON data

Posted by Gary Gregory <ga...@gmail.com>.
Note that json.org is a spec, not an implementation.

Gary


On Wed, Apr 10, 2013 at 2:13 PM, Daniel Pitts <co...@gmail.com>wrote:

> Do you mean "a common way" or "the Commons way". json.org is pretty much
> canonical when it comes to JSON encoding. How much more common do you need?
> I realize that this is the apache commons user list, and it wouldn't hurt
> to have Commons support JSON better. However as an pragmatic engineer, I
> would use json.org before asking the apache community to duplicate that
> functionality, unless there are issues with licensing for you. I don't know
> off the top of my head what license json.org uses.
>
> On 4/10/13 2:37 AM, Maurizio Cucchiara wrote:
>
>> Actually, when I was talking about the best way, I was asking for a
>> "common" way.
>>
>> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
>>
>>> I might suggest looking into the json.org library.
>>>
>>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [LANG] How to escape JSON data

Posted by Daniel Pitts <co...@gmail.com>.
Do you mean "a common way" or "the Commons way". json.org is pretty much 
canonical when it comes to JSON encoding. How much more common do you 
need? I realize that this is the apache commons user list, and it 
wouldn't hurt to have Commons support JSON better. However as an 
pragmatic engineer, I would use json.org before asking the apache 
community to duplicate that functionality, unless there are issues with 
licensing for you. I don't know off the top of my head what license 
json.org uses.

On 4/10/13 2:37 AM, Maurizio Cucchiara wrote:
> Actually, when I was talking about the best way, I was asking for a
> "common" way.
>
> On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
>> I might suggest looking into the json.org library.
>>


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


Re: [LANG] How to escape JSON data

Posted by Maurizio Cucchiara <mc...@apache.org>.
Actually, when I was talking about the best way, I was asking for a
"common" way.

On 10 April 2013 02:39, Daniel Pitts <co...@gmail.com> wrote:
> I might suggest looking into the json.org library.
>
>
> On 4/9/13 7:36 AM, Maurizio Cucchiara wrote:
>>
>> OK,
>> there is already an opened issue [1]
>>
>> [1] https://issues.apache.org/jira/browse/LANG-797
>>
>> 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
>>
>>
>> On 9 April 2013 12:51, Maurizio Cucchiara <mc...@apache.org> wrote:
>>>
>>> Hi guys,
>>> what is the best way to escape json data?
>>>
>>> We (the Struts team) have been experiencing an issue [1] with the ECMA
>>> Script translator (which, at first glance, could seem the right one).
>>>
>>> It turned out that the Java translator which best fits to JSON, but I
>>> don't think it's a good solution to use a translator designed for
>>> other needs.
>>>
>>> Should we define a custom translator?
>>>
>>> [1] https://issues.apache.org/jira/browse/WW-4041
>>>
>>>
>>> Twitter     :http://www.twitter.com/m_cucchiara
>>> G+          :https://plus.google.com/107903711540963855921
>>> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>>>
>>> Maurizio Cucchiara
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

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


Re: [LANG] How to escape JSON data

Posted by Daniel Pitts <co...@gmail.com>.
I might suggest looking into the json.org library.

On 4/9/13 7:36 AM, Maurizio Cucchiara wrote:
> OK,
> there is already an opened issue [1]
>
> [1] https://issues.apache.org/jira/browse/LANG-797
>
> 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
>
>
> On 9 April 2013 12:51, Maurizio Cucchiara <mc...@apache.org> wrote:
>> Hi guys,
>> what is the best way to escape json data?
>>
>> We (the Struts team) have been experiencing an issue [1] with the ECMA
>> Script translator (which, at first glance, could seem the right one).
>>
>> It turned out that the Java translator which best fits to JSON, but I
>> don't think it's a good solution to use a translator designed for
>> other needs.
>>
>> Should we define a custom translator?
>>
>> [1] https://issues.apache.org/jira/browse/WW-4041
>>
>>
>> Twitter     :http://www.twitter.com/m_cucchiara
>> G+          :https://plus.google.com/107903711540963855921
>> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>>
>> Maurizio Cucchiara
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


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


Re: [LANG] How to escape JSON data

Posted by Maurizio Cucchiara <mc...@apache.org>.
OK,
there is already an opened issue [1]

[1] https://issues.apache.org/jira/browse/LANG-797

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


On 9 April 2013 12:51, Maurizio Cucchiara <mc...@apache.org> wrote:
> Hi guys,
> what is the best way to escape json data?
>
> We (the Struts team) have been experiencing an issue [1] with the ECMA
> Script translator (which, at first glance, could seem the right one).
>
> It turned out that the Java translator which best fits to JSON, but I
> don't think it's a good solution to use a translator designed for
> other needs.
>
> Should we define a custom translator?
>
> [1] https://issues.apache.org/jira/browse/WW-4041
>
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara

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