MultiPart/Form Encoding problem

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiPart/Form Encoding problem

Claudio Delgado
All,

This is Claudio Delgado, I'm developing a XForm that uploads files and has text fields. The problem is when some one fills the form out with non-ASCII characters, those characters are missed due to Multipart/Form encoding.
 
I really appreciate if you could give me an advise to solve this issue.

Thanks in advance,

Claudio Delgado.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MultiPart/Form Encoding problem

Erik Bruchez
Administrator
Hi Claudio,

Somebody else has reported a similar problem recently. We managed to
reproduce it on Linux but not on Windows. What OS / JDK / Servlet
container / browser are you using?

-Erik

[hidden email] wrote:
> All,
>
> This is Claudio Delgado, I'm developing a XForm that uploads files and has text fields. The problem is when some one fills the form out with non-ASCII characters, those characters are missed due to Multipart/Form encoding.
>  
> I really appreciate if you could give me an advise to solve this issue.
>
> Thanks in advance,
>
> Claudio Delgado.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: MultiPart/Form Encoding problem

Claudio Delgado
Hi Erik,

Thanks for your answer...

Regarding this issue, we are using Windows 2000/v5.0, JDK 1.4.2_07-b05,
Tomcat  4.1.30. IE 6.0 and Firefox/1.0.4.

I wrote a Java processor to transform the XML received by Oberon to UTF-8
posted as multipart/form:

                Document insertDocument = readInputAsDOM4J(context, INPUT_DATA);
            byte[] encodedDocument = insertDocument.asXML().getBytes();
            String encodedUTF8 = new String(encodedDocument,"UTF-8");

And it solves the problem partially. I filled the form out with all
ISO-8859-1 characters and the problem persists with the characters: ?-193,
?-205, ?-207, ?-208, ?-221.


Thanks in advance,

Claudio


-----Mensaje original-----
De: Erik Bruchez [mailto:[hidden email]]
Enviado el: Mi?rcoles, 27 de Julio de 2005 22:27
Para: [hidden email]
Asunto: Re: [ops-users] MultiPart/Form Encoding problem


Hi Claudio,

Somebody else has reported a similar problem recently. We managed to
reproduce it on Linux but not on Windows. What OS / JDK / Servlet
container / browser are you using?

-Erik

[hidden email] wrote:
> All,
>
> This is Claudio Delgado, I'm developing a XForm that uploads files and has
text fields. The problem is when some one fills the form out with non-ASCII
characters, those characters are missed due to Multipart/Form encoding.
>
> I really appreciate if you could give me an advise to solve this issue.
>
> Thanks in advance,
>
> Claudio Delgado.





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MultiPart/Form Encoding problem

Erik Bruchez
Administrator
Claudio,

This has to be fixed for 3.0 final. Is there any way you can send us
your example? With some luck, we can manage to reproduce it, and the
easier we can reproduce it, the faster it's going to be fixed :-)

-Erik

Claudio Delgado wrote:

> Hi Erik,
>
> Thanks for your answer...
>
> Regarding this issue, we are using Windows 2000/v5.0, JDK 1.4.2_07-b05,
> Tomcat  4.1.30. IE 6.0 and Firefox/1.0.4.
>
> I wrote a Java processor to transform the XML received by Oberon to UTF-8
> posted as multipart/form:
>
> Document insertDocument = readInputAsDOM4J(context, INPUT_DATA);
>             byte[] encodedDocument = insertDocument.asXML().getBytes();
>             String encodedUTF8 = new String(encodedDocument,"UTF-8");
>
> And it solves the problem partially. I filled the form out with all
> ISO-8859-1 characters and the problem persists with the characters: Á-193,
> Í-205, Ï-207, Ð-208, Ý-221.
>
>
> Thanks in advance,
>
> Claudio
>
>
> -----Mensaje original-----
> De: Erik Bruchez [mailto:[hidden email]]
> Enviado el: Miércoles, 27 de Julio de 2005 22:27
> Para: [hidden email]
> Asunto: Re: [ops-users] MultiPart/Form Encoding problem
>
>
> Hi Claudio,
>
> Somebody else has reported a similar problem recently. We managed to
> reproduce it on Linux but not on Windows. What OS / JDK / Servlet
> container / browser are you using?
>
> -Erik
>
> [hidden email] wrote:
>
>>All,
>>
>>This is Claudio Delgado, I'm developing a XForm that uploads files and has
>
> text fields. The problem is when some one fills the form out with non-ASCII
> characters, those characters are missed due to Multipart/Form encoding.
>
>>I really appreciate if you could give me an advise to solve this issue.
>>
>>Thanks in advance,
>>
>>Claudio Delgado.
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: MultiPart/Form Encoding problem

Claudio Delgado
Erik,

This problem happens in any multipart form when it is filled out with
"special" UNICODE character such as ? ? ...

I was seen Orbeon source code and the problem is at
ServletExternalContext.java in the method: getParameterMapMultipart
in the line:

   NetUtils.addValueToStringArrayMap(uploadParameterMap,
fileItem.getFieldName(), fileItem.getString());

Even you have written the following comment:

// FIXME: FORM_ENCODING getString() should use an encoding


Thanks for your time.

Claudio

-----Mensaje original-----
De: Erik Bruchez [mailto:[hidden email]]
Enviado el: Jueves, 28 de Julio de 2005 13:52
Para: [hidden email]
Asunto: Re: [ops-users] MultiPart/Form Encoding problem


Claudio,

This has to be fixed for 3.0 final. Is there any way you can send us
your example? With some luck, we can manage to reproduce it, and the
easier we can reproduce it, the faster it's going to be fixed :-)

-Erik

Claudio Delgado wrote:

> Hi Erik,
>
> Thanks for your answer...
>
> Regarding this issue, we are using Windows 2000/v5.0, JDK 1.4.2_07-b05,
> Tomcat  4.1.30. IE 6.0 and Firefox/1.0.4.
>
> I wrote a Java processor to transform the XML received by Oberon to UTF-8
> posted as multipart/form:
>
> Document insertDocument = readInputAsDOM4J(context, INPUT_DATA);
>             byte[] encodedDocument = insertDocument.asXML().getBytes();
>             String encodedUTF8 = new String(encodedDocument,"UTF-8");
>
> And it solves the problem partially. I filled the form out with all
> ISO-8859-1 characters and the problem persists with the characters: ?-193,
> ?-205, ?-207, ?-208, ?-221.
>
>
> Thanks in advance,
>
> Claudio
>
>
> -----Mensaje original-----
> De: Erik Bruchez [mailto:[hidden email]]
> Enviado el: Mi?rcoles, 27 de Julio de 2005 22:27
> Para: [hidden email]
> Asunto: Re: [ops-users] MultiPart/Form Encoding problem
>
>
> Hi Claudio,
>
> Somebody else has reported a similar problem recently. We managed to
> reproduce it on Linux but not on Windows. What OS / JDK / Servlet
> container / browser are you using?
>
> -Erik
>
> [hidden email] wrote:
>
>>All,
>>
>>This is Claudio Delgado, I'm developing a XForm that uploads files and has
>
> text fields. The problem is when some one fills the form out with
non-ASCII

> characters, those characters are missed due to Multipart/Form encoding.
>
>>I really appreciate if you could give me an advise to solve this issue.
>>
>>Thanks in advance,
>>
>>Claudio Delgado.
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email]
mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: MultiPart/Form Encoding problem

Alessandro  Vernet
Administrator
--- Claudio Delgado <[hidden email]> wrote:
> This problem happens in any multipart form when it is filled out with
> "special" UNICODE character such as ? ? ...

Claudio,

Can you try to start VM with the -Dfile.encoding=UTF-8 argument and see if
you can still have this problem?

Alex

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Custom processors and subclasses

Sebastien Noir
In reply to this post by Claudio Delgado
Hello!

I'm writing custom processors for the scala language. Thinks are going
well now, and processors allowing translation from DOM4j to scala xml
and back are almost totally functional. However, I have a little
problem, which could turn out to be a feature request.

When you write a custom processor, you have to implement a generateXXX
method, to produce xml for each output of your processor. At runtime,
using reflection, the custom processor is analysed to find those
generateXXX methods. My problem is simple : the code of SimpleProcessor
(the one you have to inherit) searches for generateXXX methods only in
the class, and not in the class hierarchy... So it seems impossible to
write a custom abstract processor and to specialize it using inheritance...

There is however a (really ugly) solution : override the generateXXX
metod in each processor of the inheritance hierarchy, each time just
calling the superclass generateXXX method.... This way it will be
visible for reflection searching.

Would it be possible to modify the SimpleProcessor code to also search
the class hierarchy (replace getDeclaredMethods() by getMethods() ), or
am I missing something so I can't understand why it has been done this way?

Thanks for the great help provided so far in this big adventure...

S?bastien Noir



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Custom processors and subclasses

Erik Bruchez
Administrator
Hi Sebastien,

We are glad things are progressing!

Thanks for the bug report. Here is the bug entry:

https://forge.objectweb.org/tracker/index.php?func=detail&aid=303997&group_id=168&atid=350207

You can also write your own version of the SimpleProcessor, and/or
directly inherit from ProcessorImpl, as most of the OPS built-in
processors do.

-Erik

Sebastien Noir wrote:
 > Hello!
 >
 > I'm writing custom processors for the scala language. Thinks are going
 > well now, and processors allowing translation from DOM4j to scala xml
 > and back are almost totally functional. However, I have a little
 > problem, which could turn out to be a feature request.
 >
 > When you write a custom processor, you have to implement a generateXXX
 > method, to produce xml for each output of your processor. At runtime,
 > using reflection, the custom processor is analysed to find those
 > generateXXX methods. My problem is simple : the code of SimpleProcessor
 > (the one you have to inherit) searches for generateXXX methods only in
 > the class, and not in the class hierarchy... So it seems impossible to
 > write a custom abstract processor and to specialize it using
inheritance...
 >
 > There is however a (really ugly) solution : override the generateXXX
 > metod in each processor of the inheritance hierarchy, each time just
 > calling the superclass generateXXX method.... This way it will be
 > visible for reflection searching.
 >
 > Would it be possible to modify the SimpleProcessor code to also search
 > the class hierarchy (replace getDeclaredMethods() by getMethods() ), or
 > am I missing something so I can't understand why it has been done
this way?
 >
 > Thanks for the great help provided so far in this big adventure...
 >
 > Sébastien Noir




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws