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

Improve JsonLocation source handling: do not assume UTF-8 for byte sources #376

Closed
cowtowncoder opened this issue May 15, 2017 · 1 comment

Comments

@cowtowncoder
Copy link
Member

Although 2.9 improves handling of source references, and works nicely for JSON input, handling of byte sources (like byte[]) is problematic for binary formats like Smile and CBOR as it tries to decode a snippet in UTF-8. This won't work and instead we should either:

  1. Display snippet in hex instead, OR
  2. Just not display anything

Determination for this could be done in multiple ways; for example:

  1. Use heuristics to see if first N bytes are UTF-8 safe
  2. Use existing (or, possibly added) calls to determine if format is textual/binary

Either way, it'd be good to display UTF-8 contents for textual formats; and avoid problems for binary formats.

@cowtowncoder
Copy link
Member Author

I think this is covered by #694 wrt binary formats, and perhaps by #658 (for textual).
Closing; should re-file for remaining issues, if any.

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

1 participant