> From: Vitor Rui Moreira [mailto:[EMAIL PROTECTED]
> Sent: Mittwoch, 2. Juli 2003 20:46
> To: [EMAIL PROTECTED]
> Subject: Re: Form encoding problem in cocoon 2.0.4
> 
> Joerg Heinicke wrote:
> 
> > Vitor Rui Moreira wrote:
> >
> >>> But UTF-8 is a super set of ISO-8859-1, so there should be no 
> >>> problem when using it. 

UTF-8 is *not* a superset of ISO-8859-1.  Both UTF-8 and ISO-8859-1
are supersets of 7-bit-ASCII but for umlauts and accents they differ.

> > If so, is it an XML or a text file? I guess you must set 
> the encoding 
> > correctly when reading/parsing the file. I don't know if the 
> > form-encoding has influence of the file content. 

In a file upload the file content is just a byte stream of what the
browser reads off the client's disk.  There is no way to command the
browser to apply any codeset conversion nor to know what the browser
thinks the encoding is.

If you want to read character data from a byte stream you *must* know
the encoding and apply for example InputStreamReader(InputStream in,
String charsetName) for the decoding.

> Ok, i'm not having file content problems... all is correct, i 
> can upload 
> correctly all kind of files (.doc, .txt, .whatever).

You don't have a problem with the file content only because you
don't look at it.  As long as your benchmark is to do a binary
copy, you are fine.

> My problem is only about the filename encoding... the file, on the 
> server, as the correct content but the wrong filename (for example, 
> "t�pico" is transformed to "t??pico")...

Here you have the problem.  Browser sends the *binary* (ISO-8859-1)
filename, and MultipartParser.readln() screws it up by casting byte
to char.

Should be easy to fix.  Just note that the package was renamed from
a.o.c.components.request.multipart.MultipartParser in 2.0 to
a.o.c.servlet.request.multipart.MultipartParser in 2.1.

HTH. Alfred.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to