From 4bc3e9b5b43ccdd6b657ba22ba2b263cba77f474 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Thu, 6 Jun 2024 17:36:50 -0700 Subject: [PATCH] Update release notes wrt #86 fix --- release-notes/VERSION | 3 +++ .../java/com/fasterxml/aalto/out/ByteXmlWriter.java | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/release-notes/VERSION b/release-notes/VERSION index 758361e..fefec29 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -6,6 +6,9 @@ Project: aalto-xml 1.3.3 (not yet released) +#86: Multi-byte characters are split in writeCData() if first byte sits + right at the end of the buffer + (reported, fix contributed by @tatsel) #90: Update stax2-api dep to 4.2.2 (from 4.2) 1.3.2 (25-Apr-2022) diff --git a/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java b/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java index c1cacf8..64517a4 100644 --- a/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java +++ b/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java @@ -794,17 +794,15 @@ protected int writeCDataContents(char[] cbuf, int offset, int len) { if (_surrogate != 0) { outputSurrogates(_surrogate, cbuf[offset]); -// reset the temporary surrogate storage + // reset the temporary surrogate storage _surrogate = 0; ++offset; --len; } - /* Unlike with writeCharacters() and fastWriteName(), let's not - * worry about split buffers here: this is unlikely to become - * performance bottleneck. This allows keeping it simple; and - * should it matter, we could start doing fast version here - * as well. - */ + // Unlike with writeCharacters() and fastWriteName(), let's not + // worry about split buffers here: this is unlikely to become + // performance bottleneck. This allows keeping it simple; and + // should it matter, we could start doing fast version here as well. len += offset; // now marks the end main_loop: