[webkit-reviews] review denied: [Bug 73980] webkit.py gdb pretty printer should consider 8-bit characters of StringImpl. : [Attachment 118301] rebased

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 7 18:33:21 PST 2011


Tony Chang <tony at chromium.org> has denied Hayato Ito <hayato at chromium.org>'s
request for review:
Bug 73980: webkit.py gdb pretty printer should consider 8-bit characters of
StringImpl.
https://bugs.webkit.org/show_bug.cgi?id=73980

Attachment 118301: rebased
https://bugs.webkit.org/attachment.cgi?id=118301&action=review

------- Additional Comments from Tony Chang <tony at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=118301&action=review


> Tools/gdb/webkit.py:60
> +def ustring_to_unicode_string(ptr, length=None):
>      """Convert a pointer to UTF-16 data into a Python Unicode string.

We should try to be consistent with our use of unicode strings or utf8 strings.
 Using utf8 might be easier, but I'll defer to your judgement.

> Tools/gdb/webkit.py:71
>      string = struct.pack('H' * length, *char_vals).decode('utf-16',
'replace')
> +    return string + unicode(error_message)

You could use utf8 for both of these.

> Tools/gdb/webkit.py:133
> +	       return lstring_to_string(self.val['m_data8'], self.get_length())

> +	   return ustring_to_unicode_string(self.val['m_data16'],
self.get_length()).encode('utf-8')

And could drop the extra encode('utf-8') here.


More information about the webkit-reviews mailing list