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

Exception is thrown in JSON parser ParseString (char[] json, ref int index, ref bool success) #39

Open
romansavrulin opened this issue May 20, 2015 · 2 comments

Comments

@romansavrulin
Copy link

The function in lib/JSON.cs:193 protected static string ParseString (char[] json, ref int index, ref bool success)
throws an exception "The argument must not be in surrogate pair range" in lib/JSON.cs:244 s.Append (Char.ConvertFromUtf32 ((int)codePoint)); that is not handled by (tested on instagram API, media/popular endpoint). If you assume JSON API return status code via bool argument, this exception must be handled.

I've muted it with

try{
  // convert the integer codepoint to a unicode char and add to string
  s.Append (Char.ConvertFromUtf32 ((int)codePoint));
}catch(Exception e){
  s.Append ( "" );
}

it works, but i'm not sure if it is correct logic.

@andyburke
Copy link
Owner

Can you add some example JSON that causes this exception to throw?

@romansavrulin
Copy link
Author

try this one (remove .jpg from filename)
blow json

In spite of the cause of exception, it must be handled internally in this function.

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

2 participants