[Webkit-unassigned] [Bug 13415] Add UTF-32 support for html/xml documents

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 1 01:32:18 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=13415


ap at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14220|review?                     |review-
               Flag|                            |




------- Comment #12 from ap at webkit.org  2007-05-01 01:32 PDT -------
(From update of attachment 14220)
r- for now, but the patch looks really good to me!

+    unsigned char c3 = buf1Len ? (--buf1Len, *buf1++) : buf2Len ? (--buf2Len,
*buf2++) : 0;
+    unsigned char c4 = buf2Len ? (--buf2Len, *buf2++) : 0;
...
+    if (c1 == 0xFF && c2 == 0xFE) {
+        if (c3 != 0 || c4 != 0) 
+            encodingConsideringBOM = &UTF16LittleEndianEncoding();
+        else 
+            encodingConsideringBOM = &UTF32LittleEndianEncoding();
+    }

You need to check why c3 and c4 are zero - if there are only two bytes
available yet, it may be too early to assume UTF-32.

     else if (numBufferedBytes + length <= sizeof(m_bufferedBytes) && !flush) {
         // Continue to look for the BOM.

I believe m_bufferedBytes size should be increased to three bytes, now that we
deal with 4-byte BOMs.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list