Bug 18277

Summary: incorrectly encoded form submission with utf-16
Product: WebKit Reporter: Simon Hausmann <hausmann>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, vestbo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
utf-16 encoded html testcase
none
automated test case none

Simon Hausmann
Reported 2008-04-02 06:20:27 PDT
The attached html file is encoded in utf-16. Loading it in Safari and pressing the submit button produces a bad query. Both parameters and values are truncated to one character. We traced part of the problem down to fixLineBreaks in FormDataList.cpp, which operates in this case on a utf-16 encoded CString and uses zero-termination for determining the end of the string instead of using the length() property of the CString. This may solve the problem only partly, it could be that other code has the same problem.
Attachments
utf-16 encoded html testcase (482 bytes, text/html)
2008-04-02 06:21 PDT, Simon Hausmann
no flags
automated test case (1.95 KB, text/html)
2008-04-03 07:04 PDT, Alexey Proskuryakov
no flags
Simon Hausmann
Comment 1 2008-04-02 06:21:19 PDT
Created attachment 20290 [details] utf-16 encoded html testcase
Alexey Proskuryakov
Comment 2 2008-04-03 07:04:27 PDT
Created attachment 20312 [details] automated test case
Alexey Proskuryakov
Comment 3 2009-04-02 02:00:46 PDT
This was fixed in bug 21635 - we now replace UTF-16 with UTF-8 for form submission. So, my attached automated test still fails, but that's ok. *** This bug has been marked as a duplicate of 21635 ***
Note You need to log in before you can comment on or make changes to this bug.