commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: [FileUpload] error in parsing the double-bytes characters name
Date Fri, 07 Jan 2005 04:44:59 GMT
You probably want to use FileItem.getString(String encoding) instead
of the getString() that uses the default encoding.

--
Martin Cooper


On Wed, 5 Jan 2005 10:25:17 +0800, jacky <jacky_chenp@hotmail.com> wrote:
> lib:
>   FileUpload 1.0 - 24 Jun 2003
> 
> src:
> FileUploadBase fu = new DiskFileUpload();
> List fileItems = null;
> try
>    {
>            fileItems = fu.parseRequest(request);
>            Iterator iter = fileItems.iterator();
>            FileItem fileitem = null;
> 
>            while(iter.hasNext())
>            {
>                // here, item is not a file item, just a simple form field
>                FileItem item = (FileItem) iter.next();
>                String itemname = item.getString();
>            }
>    }
> 
> client: os(windowsXP sp1),encoding(gbk) browser(IE6.0)
> server: os(windowsXP sp1), encoding(gbk) tomcat4.1.30
>  The result is correct.
> 
> client: os(windowsXP sp1),encoding(gbk) browser(IE6.0)
> server: os(linux redhat7.3), encoding(ISO8859-15) tomcat4.1.30
>  itemname is not the correct string.
>  I use fu.setEncoding("ISO8859-15"), itemname is still not correct,
> then i think maybe the encoding should be the same as the client's,
> so i use fu.setEncoding("gbk"), itemname is still not correct.
> 
>

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


Mime
View raw message