Ignore:
Timestamp:
Nov 14, 2007, 9:59:40 PM (18 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

http://bugs.webkit.org/show_bug.cgi?id=15982
Improve JSString UTF-8 decoding

  • API/JSStringRef.cpp: (JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
  • wtf/unicode/UTF8.cpp: (WTF::Unicode::convertUTF16ToUTF8): (WTF::Unicode::convertUTF8ToUTF16):
  • wtf/unicode/UTF8.h: Made these function names start with a lower case letter.
  • kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
  • bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference from convertUTF8ToUTF16 in wtf/unicode. (KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming. (KJS::Bindings::identifierFromNPIdentifier): Ditto.
  • bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSStringRef.cpp

    r27746 r27810  
    5555    Vector< ::UChar, 1024> buffer(length);
    5656    ::UChar* p = buffer.data();
    57     ConvertUTF8ToUTF16(&string, string + length, &p, p + length, false);
     57    if (conversionOK != convertUTF8ToUTF16(&string, string + length, &p, p + length))
     58        return 0;
    5859
    5960    return toRef(UString(reinterpret_cast<KJS::UChar*>(buffer.data()), p - buffer.data()).rep()->ref());
Note: See TracChangeset for help on using the changeset viewer.