Skip to content
  • msaboff@apple.com's avatar
    convertUTF8ToUTF16() Should Check for ASCII Input · d43bd362
    msaboff@apple.com authored
    ihttps://bugs.webkit.org/show_bug.cgi?id=99739
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore: 
    
    Using the updated convertUTF8ToUTF16() , we can determine if is makes more sense to 
    create a string using the 8 bit source.  Added a new OpaqueJSString::create(LChar*, unsigned).
    Had to add a cast n JSStringCreateWithCFString to differentiate which create() to call.
    
    * API/JSStringRef.cpp:
    (JSStringCreateWithUTF8CString):
    * API/JSStringRefCF.cpp:
    (JSStringCreateWithCFString):
    * API/OpaqueJSString.h:
    (OpaqueJSString::create):
    (OpaqueJSString):
    (OpaqueJSString::OpaqueJSString):
    
    Source/WTF: 
    
    Added code to accumulate the "or" of all characters seen during the UTF8 to UTF16 conversion.  This is
    used to check to see if all characters are ASCII and is returned via a bool*.
    
    * wtf/unicode/UTF8.cpp:
    (WTF::Unicode::convertUTF8ToUTF16):
    * wtf/unicode/UTF8.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d43bd362