struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Evans (JIRA)" <>
Subject [jira] Reopened: (STR-1893) MultipartElement.getFileName() returns wrong filename for non-English names
Date Mon, 24 Apr 2006 20:44:09 GMT
     [ ]
David Evans reopened STR-1893:

    Assign To: David Evans  (was: Struts Developer Mailing List)

> MultipartElement.getFileName() returns wrong filename for non-English names
> ---------------------------------------------------------------------------
>          Key: STR-1893
>          URL:
>      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:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message