[opencms-dev] Encoding problem when form type is multipart/form-data

Ivan Jelenic ivan.jelenic at nbs.yu
Fri Jul 30 16:32:01 CEST 2004


Thanks a lot Sven.

I try with this:

request.setCharacterEncoding("UTF-8");
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
cms.getRequestContext().setEncoding("UTF-8");

but there was no results, too....I will try with reencoding.

Best regards,
Ivan Jelenic
ivan.jelenic at nbs.yu


----- Original Message ----- 
From: "Sven Bonorden" <bonorden at getit.de>
To: <opencms-dev at opencms.org>
Sent: Friday, July 30, 2004 4:08 PM
Subject: Re: [opencms-dev] Encoding problem when form type is
multipart/form-data


> Ivan,
>
> we had the same problem in OpenCms 5.0.1.
> Request parameter values from multipart forms were always encoded in
> ISO-8859-1 independent of the settings in Jsp, Cms or Java (which were
> all UTF-8 for us).
> We could solve the problem by reencoding the getParameter results from
> ISO-8859-1 to UTF-8 but I don't know if that also works for Cyrillic
chars.
>
> Sven
>
>
> Ivan Jelenic wrote:
>
> > Hi,
> > We are using a small form for uploading files with one text filed:
> > <form name="send" method="post" action="some.jsp"
> > enctype="multipart/form-data">
> > <br>
> > <textarea cols="80" rows="30" name="content">
> > Type your text here.
> > </textarea>
> > <br><br>
> > <input type=file name=attachment>
> > <br><br>
> > <input type=Submit value=Send>
> >
> > </form>
> > Jsp page with this form has a content-encoding property set to UTF-8
> > and jsp page specified in action, too. When I want to get text from
> > textarea I use this piece of code:
> > CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> > request, response);
> > String content =
> > cms.getRequestContext().getRequest().getParameter("content");
> > My problem is that I don't have UTF-8 characters in String variable
> > content. With uploaded file everything is fine. I try to
> > setCharacterEncoding("UTF-8") on request object before initialize
> > CmsJspActionElement but there was no results. So, when I send some
> > Cyrillic's content with file I've got something like this:
> > дфхгфдхгфдхгфд.
> > We use OpenCms5.0.0 (set to UTF-8), WinXP, MySql 4.0.15, Tomcat
> > 4.1.24LE (with -Dfile.encoding=UTF-8) and JDK 1.4.2_03.
> > Please, help.
> > Best regards,
> > Ivan Jelenic
> > ivan.jelenic at nbs.yu <mailto:ivan.jelenic at nbs.yu>
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list