Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible error in isValidJSON #8

Open
asieira opened this issue Jan 8, 2014 · 2 comments
Open

Possible error in isValidJSON #8

asieira opened this issue Jan 8, 2014 · 2 comments

Comments

@asieira
Copy link

asieira commented Jan 8, 2014

I had a strange but valid-looking JSON string be rejected by isValidJSON:

> json
[1] "{\"count\": 1, \"time_first\": 1384407052, \"rrtype\": \"A\", \"rrname\": \"s7-r\\\"\\\\027\\\\029kp9.\\\\008.ws.\", \"rdata\": \"64.70.19.198\", \"time_last\": 1384407052}"
> isValidJSON(json, asText=T)
[1] FALSE

So I tested, and turns out that fromJSON is able to parse it properly:

> fromJSON(json)
$count
[1] 1

$time_first
[1] 1384407052

$rrtype
[1] "A"

$rrname
[1] "s7-r\"\\027\\029kp9.\\008.ws."

$rdata
[1] "64.70.19.198"

$time_last
[1] 1384407052

Moreover, JSONlint says this is a valid JSON entry:
jsonlint

So I am thinking that this might be a bug in isValidJSON.

@jeroen
Copy link

jeroen commented Jan 18, 2014

This is a bug in the underlying libjson library. It has been fixed in the latest version of the libjson, however RJSONIO still uses an old version. The jsonlite package uses the latest version though :)

@duncantl
Copy link
Owner

Thanks Jeroen. Yep it is a bug in libjson.
I will put a new version of RJSONIO on CRAN very soon.
However, you can use a new version of libjson with the existing RJSONIO when installing RJSONIO from source. For quite some time, we have been able to use an alternative version of the libjson than the one that comes with RJSONIO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants