• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

utf-8 on actionform

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I need to use utf-8 on my form. The JSP shows non-ascii characters well, but when I get back into my action I can't get the values from my attributes on utf-8. I'm sure the problem is only on the form, because I can get utf-8 strings from my resources file and display it properly. For example:

14:33:57,312 INFO [STDOUT] 43 - Siguiente subcategor��a - Siguiente subcategor�a



Where I get the text before the '-' from my form, and the text after from my resources file.

I'm declaring utf8 on my JSP as following:



Can anybody help? Thanks in advance...
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't believe that UTF-8 is the right value to use as character set for European languages. Try ISO-8859-1 instead.
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that "multipart/form-data: charset=utf-8" is not a valid enctype; the encoding can't be specified in this way. Generally, the browser will use whatever encoding the page was delivered in. So if the contentType is UTF-8, then it should use UTF-8 for the form submission.

To make this explicit you can use the "accept-charset" form attribute. At least, that's what the HTML standard says how it should happen.
[ June 24, 2008: Message edited by: Ulf Dittmer ]
 
Roberto Lopez Lopez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Merrill: ask my boss, it's one of the requirements...

The JSP has now these lines:



But the data from the form keeps "Siguiente subcategor��a" instead of "Siguiente subcategor�a". I've tried with other html:form attributes, but simply can't avoid this error. Any idea there? Is there another way to define the encoding?
 
Roberto Lopez Lopez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SOLVED:

JBoss sends everything in ISO-8859-1, even if I say UTF-8 on the jsp. I wrote a method to traduce every message into UTF-8.





Now I'm writing a filter to automatically traduce everything without need to call this method.

Thanks for your support!!!

Reference:http://www.jboss.com/index.html?module=bb&op=viewtopic&t=84678#3952987
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem can be solved by adding the following code to the actionform reset and validate methods:
 
reply
    Bookmark Topic Watch Topic
  • New Topic