You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Dolf Dijkstra (JIRA)" <ji...@apache.org> on 2007/04/25 12:56:16 UTC

[jira] Commented: (HTTPCLIENT-293) Provide support for non-ASCII charsets in the multipart disposition-content header

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491599 ] 

Dolf Dijkstra commented on HTTPCLIENT-293:
------------------------------------------

I have created a patch against revision 532277 for this problem. Although it is not according to the RFC it does do the job. For instance IE is doing the same for multi-part mime upload. Not that I am suggesting that IE is doing the right thing, but it does mean that probably many servers can deal with post.

Index: src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java
===================================================================
--- src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java	(revision 532277)
+++ src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java	(working copy)
@@ -193,7 +193,11 @@
         if (filename != null) {
             out.write(FILE_NAME_BYTES);
             out.write(QUOTE_BYTES);
-            out.write(EncodingUtil.getAsciiBytes(filename));
+            //still not the rigth thing according to RFC1522
+            out.write( EncodingUtil.getBytes( filename, this.getCharSet() ) );
+            /*TODO: the right thing would be to do this, but some MIMEDecoders can't handle it.
+             String s = MimeUtility.encodeText(filename);
+             */
             out.write(QUOTE_BYTES);
         }
     }




> Provide support for non-ASCII charsets in the multipart disposition-content header
> ----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-293
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-293
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 1.0 Alpha
>         Environment: Operating System: All
> Platform: All
>            Reporter: Eric Dofonsou
>            Priority: Minor
>             Fix For: 4.0 Final
>
>
> Because of the the following line in getAsciiBytes 
>  data.getBytes("US-ASCII");
> The returned string is modified if has Latin Characters.
> Ex : Document non-controlé -> Document non-control?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org