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

Ivan Jelenic ivan.jelenic at nbs.yu
Fri Jul 30 10:48:00 CEST 2004


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040730/73908ff5/attachment.htm>


More information about the opencms-dev mailing list