[ http://issues.apache.org/struts/browse/STR-1893?page=all ]
David Evans closed STR-1893:
----------------------------
Resolution: Fixed
> MultipartElement.getFileName() returns wrong filename for non-English names
> ---------------------------------------------------------------------------
>
> Key: STR-1893
> URL: http://issues.apache.org/struts/browse/STR-1893
> Project: Struts Action 1
> Type: Bug
> Components: Action
> Versions: 1.1 Final
> Environment: Operating System: other
> Platform: Other
> Reporter: breezee26
> Assignee: David Evans
>
> When upload a file which has a non-English name,
> the upload component can not get the correct filename.
> The problem is caused by the following reason:
> MultipartIterator is using MultipartBoundaryInputStream, that has the
> function:
> private final String readLine()
> In that function there is :
> line = new String(this.line, 0, this.lineLength);
> This causes the byte array to be treated as if it would have been in default
> encoding.
> The corrected code should include an "encoding" class parameter, that would
> be
> initialized in the MultipartBoundaryInptStream constructor (should be the
> encoding of the request or the MultipartElement), and than the above code of
> readLine() would be changed to :
> line = new String(this.line, 0, this.lineLength, this.encoding);
> I'd like to mention that for MultipartElement.getName() and
> MultipartElement.getValue() the bug doesn't occur. this is thanks to the
> function MultipartIterator.createTextMultipartElement() that is considering
> the
> encoding at the line:
> String value = baos.toString(encoding);
> So text elements are working fine, but file elements are using the above
> readLine() method, and there we see the bug.
>
> This is seriously harming Struts i18n support, we really need this fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]