开发者

Form encoding in Tapestry

I have a problem with Tapestry form. My XML database is very sensible with encoding, and need utf-8.

When i put the char 'à' in my form, tapestry receive 'Ó' and my core get an error : Invali开发者_JS百科d byte 2 of 3-byte UTF-8 sequence.

I haven't the problem in eclipse with local default configuration for tomcat.

But whatever the tomcat configuration, i think my application must do the conversion itself.

So i try :

  • charset="utf-8" in form => FAIL
  • buildUtf8Filter in AppModule => FAIL

The charset of every page is always utf-8.

So, what could i do before using java Charset encoder ?

thank you for helping me. :)


I wouldn't think there's anything wrong with your application. Tapestry does everything in UTF-8 by default; that wiki page is fairly out of date (referring to the 5.0.5 beta, where apparently forms with file uploads still didn't use UTF-8 properly).

You're saying you don't have the problem locally. Have you tried running on a different server? If you do not have the problem there, there's probably something wrong with the codepage settings of the operating system on the server.

Purely anecdotal evidence below

I have once had a similar character set problem in a Tapestry 5 app on the production server (running SUSE Linux) that I could not reproduce on any other server. All seemed fine with the application, the Tomcat server, and the codepage settings of the system, but POST data would end up decoded as ISO 8859-1 instead of UTF-8 in the application. The app had run on that server for a year before the problem manifested - maybe through an update in the operating system.

Afer a day of not getting anywhere, we ended up just re-installing the whole server OS, and everything was fine again.


The problem was about the default charset of the JVM launched into windows shell. It caused trouble with FileWriter and then show bad character in the console :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜