[webkit-reviews] review granted: [Bug 178207] UTF-8 decoding produces one replacement character per byte; Encoding standard requires one replacement character per illegal sequence instead : [Attachment 323843] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 15 12:46:36 PDT 2017


Sam Weinig <sam at webkit.org> has granted Darin Adler <darin at apple.com>'s request
for review:
Bug 178207: UTF-8 decoding produces one replacement character per byte;
Encoding standard requires one replacement character per illegal sequence
instead
https://bugs.webkit.org/show_bug.cgi?id=178207

Attachment 323843: Patch

https://bugs.webkit.org/attachment.cgi?id=323843&action=review




--- Comment #15 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 323843
  --> https://bugs.webkit.org/attachment.cgi?id=323843
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=323843&action=review

> Source/WebCore/platform/text/TextCodecUTF8.cpp:441
> +    Vector<char, 3000> bytes(length * 3);

How did you decide on 3000?

> Source/WebCore/platform/text/TextCodecUTF8.cpp:448
> +    return CString { bytes.data(), bytesWritten };

It's too bad we don't have a way to avoid this copy at least in some instances.
 Perhaps at some point, we should rework CStringBuffer to allow for this.


More information about the webkit-reviews mailing list