Skip to content

carry trailing high surrogate across CodePointBuffer appends#4943

Open
rootvector2 wants to merge 1 commit into
antlr:devfrom
rootvector2:split-surrogate-pair-append
Open

carry trailing high surrogate across CodePointBuffer appends#4943
rootvector2 wants to merge 1 commit into
antlr:devfrom
rootvector2:split-surrogate-pair-append

Conversation

@rootvector2

Copy link
Copy Markdown

appendArrayInt emitted a chunk-trailing high surrogate immediately instead of holding it in prevHighSurrogate, so a surrogate pair split across two append() calls (e.g. CharStreams.fromReader filling its read buffer mid-emoji) decoded to a spurious lone surrogate before the real code point; found tracing the chunked decode path, the fix keeps it pending for the next append() and flushes a still-dangling one in build().

Signed-off-by: rootvector2 <dxbnaveed.k@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant