Add additional WKString API to make it a bit more useful.
Created attachment 69418 [details] Patch
Created attachment 69511 [details] Updated, now includes tests! Updated to include tests. (I am not thrilled with the test, it doesn't do any fancy utf8 stuff, but it is a first step).
Attachment 69511 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp:26: Found other header before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp:45: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
This seems to be duplicating some work that's being done in bug 45393
Comment on attachment 69511 [details] Updated, now includes tests! View in context: https://bugs.webkit.org/attachment.cgi?id=69511&action=review Looks good. r=me > WebKit2/Shared/WebString.h:62 > + WTF::Unicode::ConversionResult result = WTF::Unicode::convertUTF16ToUTF8(&d, d + m_string.length(), &p, p + bufferSize - 1, true); What does the true mean? maybe add a comment like /* ... */ in front of it? > WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp:34 > + WKStringRef string = WKStringCreateWithUTF8CString("hello"); Shouldn't you try constructing it using a "string" containing UTF8 specific chars?
(In reply to comment #5) > (From update of attachment 69511 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=69511&action=review > > Looks good. r=me > > > WebKit2/Shared/WebString.h:62 > > + WTF::Unicode::ConversionResult result = WTF::Unicode::convertUTF16ToUTF8(&d, d + m_string.length(), &p, p + bufferSize - 1, true); > > What does the true mean? maybe add a comment like /* ... */ in front of it? > > > WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp:34 > > + WKStringRef string = WKStringCreateWithUTF8CString("hello"); > > Shouldn't you try constructing it using a "string" containing UTF8 specific chars? Yep. I should. I am going to ask ap to help me construct some more test cases (he is quite good at that).
Landed in r68930.