question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hex capitalization for JsonWriter should be configurable

See original GitHub issue

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 https://github.com/FasterXML/jackson-core/blob/efe51e83648ed1b4c33ad1ffd5e2cbee5e0c6091/src/main/java/com/fasterxml/jackson/core/io/CharTypes.java#L7 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 https://github.com/FasterXML/jackson-core/blob/94a0e1cab04a218cb189e635727ca803dc56a958/src/main/java/com/fasterxml/jackson/core/JsonStreamContext.java#L331

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

Seen in 2.13, made from before 2.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
cowtowncodercommented, Oct 4, 2022

Implemented via #819; will be in 2.14.0-rc2 (and final 2.14.0)

1reaction
isaacasensiocommented, Jun 23, 2022

👋 I can take this one. Thanks for the heads up @pakoito 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · FasterXML/jackson-core · GitHub
Hex capitalization for JsonWriter should be configurable 2.14 Issue planned (at earliest) for 2.14 good first issue Issue that seems easy to resolve...
Read more >
Set Reader and Writer Configuration Properties
DataWeave provides configuration properties for data formats, such as JSON ( application/json ), XML ( application/xml ), and ( application/csv ).
Read more >
Is there a reason to use uppercase letters for hexadecimal ...
Lower case hex might be ok in CSS however hex numbers can be anywhere in the project code and depending on convention "0xcad"...
Read more >
WifiConfiguration - Android Developers
When set, this network configuration entry should only be used when ... or a string of hex digits, which are not enclosed in...
Read more >
Ext.util.Format | Ext JS 6.0.1 - Sencha Documentation
Format.uppercase }] ... Capitalize the first letter of the given string. ... all current configuration options will be returned as key value pairs....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found