On Mon, 3 Oct 2016 03:35:15 -0700 (PDT)
Marcin Jurczuk <[email protected]> wrote:

> > > I hit some issue with son.Marshal string parsing and I don't know
> > > is it package error or "this is not a bug - it's a feature". 
> > > 
> > > Here is code that doesn't work like expected: 
> > > https://play.golang.org/p/vAOhLCtoSh 
> > > 
> > > 
> > > Why I'm getting \u003c\u003 instead of << when printing printing
> > > out 
> > json ?? 
> >
> >
> > http://stackoverflow.com/questions/21592283/character-in-json-data-is-serialized-to-u003c
> >  
> >
> In the mean time I've founded that it has to do with HTML injections.
> Question remains how in go get rid/disable this protection ?
> I'm getting this data from SNMP communication and I have to parse
> them, display and store.
> 
> I didn't found in json library any method to handle such "protection".
> Does it mean I have to write some regex parser and call it every time
> I'm getting data from JSON  to bypass this ?

Any compatible JSON decoder is supposed to convert these \uNNNN escape
sequences into proper UTF-8 characters when decoding them.
So what is your specific problem?

I mean, you first mentioned json.Marshal and then you tell us you *get*
some JSON streams from an SNMP appliance which suggests you're dealing
with decoding (unmarshaling).  Hence I fail to comprehend the concrete
problem you have.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to