[R] backslash escape characters in JSON strings

Erik Iverson eriki at ccbr.umn.edu
Wed Jun 30 17:05:18 CEST 2010


You don't say what package fromJSON is in, or give us the ability to 
reproduce the error, since we don't know what 's' is.  If those two 
pieces of information are possible to give to the list, it will be much 
easier to help.

dabd wrote:
> Hi,
> 
> I am trying to consume a web service that returns a JSON string, however,
> when I run
>> fromJSON(s)
> Error: '\/' is an unrecognized escape in character string starting "http:\/"
> 
> because the string s contains a single backslash, which is the JSON escape
> character, but R expects 2 backslashes, I think.
> 
> Is there anyway to preprocess the JSON string returned from the web service
> so it escapes it according to R escaping rules?
> 
> Thanks.



More information about the R-help mailing list