[webkit-reviews] review granted: [Bug 216219] TextCodec refinements : [Attachment 408115] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 6 11:13:03 PDT 2020


Sam Weinig <sam at webkit.org> has granted Darin Adler <darin at apple.com>'s request
for review:
Bug 216219: TextCodec refinements
https://bugs.webkit.org/show_bug.cgi?id=216219

Attachment 408115: Patch

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




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

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

> Source/WebCore/platform/text/TextCodecCJK.cpp:542
> +	       static constexpr std::array<UChar32, 63> iso2022JPKatakana {

Annoying that you have to provide the 63 here, but it looks like that is
necessary if you want to use UChar32 explicitly, otherwise, you could do 

`static constexpr std::array iso2022JPKatakana { 0x3002, 0x300C, 0x300D ... }

and it would deduce the size for you.

> Source/WebCore/platform/text/TextCodecCJK.cpp:690
> +	   auto table = new EUCKREncodingIndex;
> +	   for (size_t i = 0; i < std::size(eucKRDecodingIndex); i++)
>	       (*table)[i] = { eucKRDecodingIndex[i].second,
eucKRDecodingIndex[i].first };

One of these days I will get around to adding a zip iterator to make this a bit
nicer.


More information about the webkit-reviews mailing list