Skip to content

Conversation

tlrx
Copy link
Contributor

@tlrx tlrx commented May 6, 2016

In its writeUTF8String() method, a FilteringGeneratorDelegate uses the delegating writeRawUTF8String() method that do not manage additional escaping:

@Override
public void writeUTF8String(byte[] text, int offset, int length) throws IOException
{
    // not exact match, but best we can do
    if (_checkRawValueWrite()) {
        delegate.writeRawUTF8String(text, offset, length);
    }
}

I think it should use the delegate.writeUTF8String() instead so that it correctly escapes required chars:

    // not exact match, but best we can do
    if (_checkRawValueWrite()) {
        delegate.writeUTF8String(text, offset, length);
    }

This pull request changes that and adds a small unit test.

@cowtowncoder cowtowncoder merged commit a8a9beb into FasterXML:master May 6, 2016
@cowtowncoder
Copy link
Member

Ah yes, good catch. Cut'n paste error. Thank you for reporting this!
I'll manually backport this in 2.7 as well.

cowtowncoder added a commit that referenced this pull request May 6, 2016
@tlrx
Copy link
Contributor Author

tlrx commented May 9, 2016

@cowtowncoder awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants