Title: [132825] trunk/Source/WebKit2
Revision
132825
Author
[email protected]
Date
2012-10-29 11:05:23 -0700 (Mon, 29 Oct 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (132824 => 132825)


--- trunk/Source/WebKit2/ChangeLog	2012-10-29 18:02:03 UTC (rev 132824)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-29 18:05:23 UTC (rev 132825)
@@ -1,3 +1,16 @@
+2012-10-29  Michael Saboff  <[email protected]>
+
+        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  <[email protected]>
 
         Add ENABLE_USERSELECT_ALL feature flag.

Modified: trunk/Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp (132824 => 132825)


--- trunk/Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp	2012-10-29 18:02:03 UTC (rev 132824)
+++ trunk/Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp	2012-10-29 18:05:23 UTC (rev 132825)
@@ -44,5 +44,7 @@
 
     // 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());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to