Commit f8a2f0d0 authored by msaboff@apple.com's avatar msaboff@apple.com

WKStringCopyCFString() should directly use 8 bit Strings data instead of up converting

https://bugs.webkit.org/show_bug.cgi?id=100579

Reviewed by Oliver Hunt.

Changed to use CFStringCreateWithBytes() for 8 bit strings using characters8() for an 8 bit argument string.
Changed the current call to characters16().

* Shared/API/c/cf/WKStringCF.cpp:
(WKStringCopyCFString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1d885e0d
2012-10-29 Michael Saboff <msaboff@apple.com>
WKStringCopyCFString() should directly use 8 bit Strings data instead of up converting
https://bugs.webkit.org/show_bug.cgi?id=100579
Reviewed by Oliver Hunt.
Changed to use CFStringCreateWithBytes() for 8 bit strings using characters8() for an 8 bit argument string.
Changed the current call to characters16().
* Shared/API/c/cf/WKStringCF.cpp:
(WKStringCopyCFString):
2012-10-29 Enrica Casucci <enrica@apple.com>
Add ENABLE_USERSELECT_ALL feature flag.
......
......@@ -44,5 +44,7 @@ CFStringRef WKStringCopyCFString(CFAllocatorRef allocatorRef, WKStringRef string
// NOTE: This does not use StringImpl::createCFString() since that function
// expects to be called on the thread running WebCore.
return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toImpl(stringRef)->string().characters()), toImpl(stringRef)->string().length());
if (toImpl(stringRef)->string().is8Bit())
return CFStringCreateWithBytes(allocatorRef, reinterpret_cast<const UInt8*>(toImpl(stringRef)->string().characters8()), toImpl(stringRef)->string().length(), kCFStringEncodingISOLatin1, true);
return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toImpl(stringRef)->string().characters16()), toImpl(stringRef)->string().length());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment