Bug 145201

Summary: Give StringView a utf8() API.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Web Template FrameworkAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Andreas Kling
Reported 2015-05-19 20:31:58 PDT
It would be nice if StringView had an API like String::utf8().
Attachments
Patch (10.75 KB, patch)
2015-05-19 20:40 PDT, Andreas Kling
no flags
Patch (6.99 KB, patch)
2015-05-19 20:41 PDT, Andreas Kling
no flags
Andreas Kling
Comment 1 2015-05-19 20:40:22 PDT
Andreas Kling
Comment 2 2015-05-19 20:41:19 PDT
WebKit Commit Bot
Comment 3 2015-05-19 22:58:03 PDT
Comment on attachment 253423 [details] Patch Clearing flags on attachment: 253423 Committed r184617: <http://trac.webkit.org/changeset/184617>
WebKit Commit Bot
Comment 4 2015-05-19 22:58:06 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5 2015-05-20 08:30:11 PDT
Comment on attachment 253423 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253423&action=review > Source/WTF/wtf/text/StringImpl.h:519 > + static WTF_EXPORT_STRING_API CString utf8ForCharacters(const LChar* characters, unsigned length); > static WTF_EXPORT_STRING_API CString utf8ForCharacters(const UChar* characters, unsigned length, ConversionMode = LenientConversion); For future consideration: It’s peculiar that these two functions are members of StringImpl. They would make more sense in the CString class itself, as free functions in UTF8.h, or possibly as members of StringView, which encapsulates character pointers and lengths.
Note You need to log in before you can comment on or make changes to this bug.