-
-
Notifications
You must be signed in to change notification settings - Fork 820
Fixes the segment logic from splitting surrogates in half and not encoding correctly #1474
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
Conversation
src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java
Outdated
Show resolved
Hide resolved
|
note: I think |
|
Looks good overall, happy to get the fix! One process thing: we'd need CLA (unless you have sent one earlier). It's here: https://github.com/FasterXML/jackson/blob/main/contributor-agreement.pdf and the usual way is to print, fill & sign, scan/photo, email to Once I get it I can do final review, approve and merge PR. I think this is also safe enough to go in |
|
Just sent the CLA |
| jp.close(); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will move to test class that verifies #223 handling (where COMBINE_UNICODE_SURROGATES_IN_UTF8 implemented).
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
cowtowncoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a bug (not using offset) and infinite-loop edge case (len == 1) to address.
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
Outdated
Show resolved
Hide resolved
…nto 2.x # Conflicts: # src/main/java/com/fasterxml/jackson/core/json/UTF8JsonGenerator.java
cowtowncoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Looks good, hoping to sanity check later, merge. |
…oding correctly (#1474)
|
Merged into 2.x, backported in 2.20 (for 2.20.1). Thank you @vitorpamplona ! This is very useful fix (even if not common bug). |
Basically, the
combineSurrogateslogic doesn't run when the two characters of a surrogate are exactly at the end of one segment and the beginning of another.Fixes #1473