Skip to content

Hex capitalization for JsonWriter should be configurable #717

Closed
@pakoito

Description

@pakoito

We're seeing inconsistencies between JS's and Jackson's representation of non-printable characters embedded in JSON strings. Where JS sends \u001b, once it goes through Jackson the field holds the string \u001B, causing all kind of hashing issues.

In

protected final static char[] HC = "0123456789ABCDEF".toCharArray();
we find that the hex values are hardcoded as capital A-F, whereas other representations such as JS's JSON.stringify indicate you should use lowercase a-f instead.

These are used in the standard JsonWriter via

CharTypes.appendQuoted(sb, currentName);

We would like to see a configuration parameter or recommended approach to overcome this issue.

Seen in 2.13, made from before 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that seems easy to resolve and is likely a good candidate for contributors new to projectpr-neededFeature request for which PR likely needed (no active development but idea is workable)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions