From: Simone B. <sim...@gm...> - 2009-01-08 22:43:32
|
Hi, first of all you may want to use the CodeHaus mailing lists, as the SourceForge ones are being discontinued. More information here: http://docs.codehaus.org/display/JETTY/Jetty+Wiki (scroll one page). On Thu, Jan 8, 2009 at 21:50, Adam Augusta <ro...@gm...> wrote: > I'm having an encoding issue after upgrading from Jetty 6.1.11 to > Jetty 6.1.14. Text data submitted via POST no longer gets > interpretted as UTF-8. If I post "Héy." the request object gives me > "HÃ(c)y." in the resultant Java string. > > I get the same problem with Jetty 6.1.12. Reverting to Jetty 6.1.11 > fixes the problem. I tried adding > "-Dorg.mortbay.util.URI.charset=utf-8" to my VM parameters with no > luck. I intercepted the HTTP request with Fiddler2 (MS proxy), and > the correct bytes are encoded in the request. (Fiddler2 also > correctly identifies the post data as "Héy.") Also, explicitly > setting the enctype and the accept-charset attributes on the Form > didn't help. > > I've included a simplified version of the web page and the controller > code below. Does anyone have any suggestions? Is this a bug in Jetty > or a configuration issue? > > Web page: > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > <html> > <head> > <title>Submission to check encoding</title><meta content="text/html; > Charset=utf-8" http-equiv="content-type" /> > </head><body> > <form method="post" > action="/www.einvite.com-6.0-SNAPSHOT/email/wording" id="theForm"> > <textarea name="testText" id="group1" rows="3" cols="40">Héy.</textarea> > <input name="textSubmit" id="textSubmit" value="Submit Text" type="submit" /> > </form> > </body> > </html> > > Controller method: (Spring 2.5 gives the request object to the method): > @RequestMapping(value = "/texttest", method = RequestMethod.POST) > public String postTestText(final HttpServletRequest request) { > final String testText = request.getParameter("testText"); > System.out.println("Text text: " + testText); > return "testText"; > } Can you post the value of the file.encoding system property ? I'm trying to exclude the fact that you only get the garbling because you print on the console. Simon -- http://bordet.blogspot.com --- Finally, no matter how good the architecture and design are, to deliver bug-free software with optimal performance and reliability, the implementation technique must be flawless. Victoria Livschitz |