Changeset 27810 in webkit for trunk/JavaScriptCore/wtf


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.
Location:
trunk/JavaScriptCore/wtf/unicode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/unicode/UTF8.cpp

    r27756 r27810  
    120120static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
    121121
    122 ConversionResult ConvertUTF16ToUTF8(
     122ConversionResult convertUTF16ToUTF8(
    123123    const UChar** sourceStart, const UChar* sourceEnd,
    124124    char** targetStart, char* targetEnd, bool strict)
     
    231231            0x03C82080UL, 0xFA082080UL, 0x82082080UL };
    232232
    233 ConversionResult ConvertUTF8ToUTF16(
     233ConversionResult convertUTF8ToUTF16(
    234234    const char** sourceStart, const char* sourceEnd,
    235235    UChar** targetStart, UChar* targetEnd, bool strict)
  • trunk/JavaScriptCore/wtf/unicode/UTF8.h

    r27746 r27810  
    6363    // they constitute an error.
    6464
    65     ConversionResult ConvertUTF8ToUTF16(
     65    ConversionResult convertUTF8ToUTF16(
    6666                    const char** sourceStart, const char* sourceEnd,
    6767                    UChar** targetStart, UChar* targetEnd, bool strict = true);
    6868
    69     ConversionResult ConvertUTF16ToUTF8(
     69    ConversionResult convertUTF16ToUTF8(
    7070                    const UChar** sourceStart, const UChar* sourceEnd,
    7171                    char** targetStart, char* targetEnd, bool strict = true);
Note: See TracChangeset for help on using the changeset viewer.