Bug 101515

Summary: HashAndUTF8CharactersTranslator should create an 8 bit string if possible
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Michael Saboff
Reported 2012-11-07 15:12:18 PST
HashAndUTF8CharactersTranslator::translate() calls convertUTF8ToUTF16() to turn the UTF8 source into character data. It should use the optional "is all ASCII" flag parameter to convertUTF8ToUTF16() and create an 8 bit string if the source is all ASCII.
Attachments
Patch (1.98 KB, patch)
2012-11-07 15:22 PST, Michael Saboff
no flags
Michael Saboff
Comment 1 2012-11-07 15:22:18 PST
Darin Adler
Comment 2 2012-11-08 10:21:57 PST
Comment on attachment 172880 [details] Patch Changes like this are better if the change log or comments state why we are doing this. I know why, but I don’t think it’s obvious why this is the right thing to do. You can imagine a different approach where we actually allocated a UTF-16 buffer and scanned it and determined the whole thing was Latin-1 even for non-ASCII cases. Presumably that’s not important, but this optimization is important. Some brief remark about how you decided to do this is needed. The change log you have here is entirely mechanical, and it says what the code does, but what people are interested in more often is why.
WebKit Review Bot
Comment 3 2012-11-08 10:48:02 PST
Comment on attachment 172880 [details] Patch Clearing flags on attachment: 172880 Committed r133918: <http://trac.webkit.org/changeset/133918>
WebKit Review Bot
Comment 4 2012-11-08 10:48:05 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.