[Yanel-dev] Sending form with multipart/form-data and UTF-8

basZero baszero at gmail.com
Mon Mar 24 16:46:36 CET 2014


accept-charset: doesn't help

I read that there must be a filter in the servlet pipeline that sets the
encoding:
request.setCharacterEncoding("UTF-8");

But it MUST be set before ANY request.getParameter(xyz)...

I tried to set in my resource, but that didn't help. So Yanel (or the
Servlet Engine itself) reads out parameters.

An option would be:
- Create a new filter servlet
- Configure it to be the very first servlet in the whole pipeline (web.xml)

... just an idea ...

Cheers, Bas


On Mon, Mar 24, 2014 at 4:43 PM, Michael Wechner
<michael.wechner at wyona.com>wrote:

>  Hi Balz
>
> Can you give it a try by using accept-charset
>
> http://www.w3schools.com/tags/att_form_accept_charset.asp
>
> I have a similar problem at the moment
>
> http://www.musealia.ch/de/index.html
>
> whereas it might also be a problem of
>
> src/webapp/src/java/org/wyona/yanel/servlet/communication/YanelFilter.java
>
> I will also have a closer look at it.
>
> Best wishes
>
> Michael
>
> Am 24.03.14 16:37, schrieb basZero:
>
> Hi,
>
> did somebody ever use a form submitting text fields as well as file input
> fields (images) ?
> I don't get it to work with UTF-8 text fields, means: special characters
> get scrambled and can not be retrieved correctly on the server side (java).
>
> <form name="form" method="post" enctype="multipart/form-data">
>   <input name="title" type="text"/>
>   <input type="file" name="image"></input>
> </form>
>
> So if you enter "Liebe Grüsse" into the title field, you get something
> scrambled on the server side.
>
> If you know how to solve it within Yanel, please share your code :-) Thanks!
> Cheers, Bas
>
>
>
>
>
>
> --
> Yanel-development mailing list Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20140324/54aca314/attachment.html>


More information about the Yanel-development mailing list