Skip to content

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

Closed
@cowtowncoder

Description

@cowtowncoder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions