Re: [Resin-interest] character encoding
No, I mean in the request... on the java side. On Wed, Sep 23, 2009 at 6:07 PM, Rick Mann rm...@latencyzero.com wrote: In a JSP? %@ page pageEncoding=UTF-8 % On Sep 23, 2009, at 12:14:35, Rom Sok wrote: Hi, Is there a way to force URI CHARACTER encoding to UTF-8? Thanks ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
Rom Sok schrieb: Is there a way to force URI CHARACTER encoding to UTF-8? No, I mean in the request... on the java side. That's poor and inefficient communication. Consider giving a complete description of what you want to achieve and how it relates to Resin. Reading this might help you in doing so: http://catb.org/~esr/faqs/smart-questions.html -- Michael Ludwig ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
Sorry, let's try this again: I am running into a problem where certain UTF-8 characters go into the application and come out as nonsense. The JSP's are using UTF-8 encoding, and so does the database. Accoridng to my research one of the things I have to do on the application side to make sure character encoding is always consistent is set the character encoding in the server configuration for URL-decoding GET request parameters. The equivalent in Tomcat configuration is *Connector (...) URIEncoding=UTF-8 /* Is there an equivalent in Resin? Thanks. On Thu, Sep 24, 2009 at 10:01 AM, Michael Ludwig m...@as-guides.com wrote: Rom Sok schrieb: Is there a way to force URI CHARACTER encoding to UTF-8? No, I mean in the request... on the java side. That's poor and inefficient communication. Consider giving a complete description of what you want to achieve and how it relates to Resin. Reading this might help you in doing so: http://catb.org/~esr/faqs/smart-questions.htmlhttp://catb.org/%7Eesr/faqs/smart-questions.html -- Michael Ludwig ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
Rom Sok schrieb: I am running into a problem where certain UTF-8 characters go into the application and come out as nonsense. Do you know the source of these characters, or maybe bytes? Application source code? Incoming HTTP request? Might you be relying on the platform's default charset (encoding)? Is your default charset indeed UTF-8? Consider: * String(byte[] bytes) - relying on the default charset here! * String(byte[] bytes, String charsetName) * String(byte[] bytes, Charset charset) java.nio.charset.Charset.defaultCharset().displayName() Accoridng to my research one of the things I have to do on the application side to make sure character encoding is always consistent is set the character encoding in the server configuration for URL-decoding GET request parameters. Is your HTML output also UTF-8? Or maybe rather ISO-8859-1, the default? The equivalent in Tomcat configuration is *Connector (...) URIEncoding=UTF-8 /* Is there an equivalent in Resin? Don't know, would have to look it up in the docs. -- Michael Ludwig ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
On Sep 24, 2009, at 7:59 AM, Rom Sok wrote: Sorry, let's try this again: I am running into a problem where certain UTF-8 characters go into the application and come out as nonsense. The JSP's are using UTF-8 encoding, and so does the database. Accoridng to my research one of the things I have to do on the application side to make sure character encoding is always consistent is set the character encoding in the server configuration for URL-decoding GET request parameters. The equivalent in Tomcat configuration is Connector (...) URIEncoding=UTF-8 / Resin should default to utf-8. The configuration is resin ... cluster id= url-character-encodingutf-8/url-character-encoding /cluster .. /resin There's also a character-encodingutf-8/character-encoding which affects all default character encodings in Resin, including POST parsing. JSP can be a bit tricky, though, because the JSP default is ISO-8859-1 (unfortunate, but it's part of the JSP spec.) The character- encoding should override the JSP default. -- Scott Is there an equivalent in Resin? Thanks. On Thu, Sep 24, 2009 at 10:01 AM, Michael Ludwig m...@as-guides.com wrote: Rom Sok schrieb: Is there a way to force URI CHARACTER encoding to UTF-8? No, I mean in the request... on the java side. That's poor and inefficient communication. Consider giving a complete description of what you want to achieve and how it relates to Resin. Reading this might help you in doing so: http://catb.org/~esr/faqs/smart-questions.html -- Michael Ludwig ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
On Sep 24, 2009, at 9:13 AM, Rom Sok wrote: Thanks, Where does character-encodingutf-8/character-encoding go? In resin.conf? If so, what's the nesting? I.e. inside what tags is it nested. It's actually contextual, though the cluster is the best place for it, because URL parsing happens at the cluster level. -- Scott Thank you, R.S. On Thu, Sep 24, 2009 at 12:03 PM, Scott Ferguson f...@caucho.com wrote: On Sep 24, 2009, at 7:59 AM, Rom Sok wrote: Sorry, let's try this again: I am running into a problem where certain UTF-8 characters go into the application and come out as nonsense. The JSP's are using UTF-8 encoding, and so does the database. Accoridng to my research one of the things I have to do on the application side to make sure character encoding is always consistent is set the character encoding in the server configuration for URL-decoding GET request parameters. The equivalent in Tomcat configuration is Connector (...) URIEncoding=UTF-8 / Resin should default to utf-8. The configuration is resin ... cluster id= url-character-encodingutf-8/url-character-encoding /cluster .. /resin There's also a character-encodingutf-8/character-encoding which affects all default character encodings in Resin, including POST parsing. JSP can be a bit tricky, though, because the JSP default is ISO-8859-1 (unfortunate, but it's part of the JSP spec.) The character-encoding should override the JSP default. -- Scott Is there an equivalent in Resin? Thanks. On Thu, Sep 24, 2009 at 10:01 AM, Michael Ludwig m...@as- guides.com wrote: Rom Sok schrieb: Is there a way to force URI CHARACTER encoding to UTF-8? No, I mean in the request... on the java side. That's poor and inefficient communication. Consider giving a complete description of what you want to achieve and how it relates to Resin. Reading this might help you in doing so: http://catb.org/~esr/faqs/smart-questions.html -- Michael Ludwig ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] character encoding
I wrote up a quick blurb on the issues surrounding character encoding on the Resteasy list recently: http://sourceforge.net/mailarchive/message.php?msg_name=540eb7210908281001r6aafaa55u78615debb704e4c1%40mail.gmail.com The short of it is that, if you can get away with it, you should set UTF-8 everywhere. In particular, you should set the platform default with -Dfile.encoding=utf-8 and ensure that all your pages are rendered in utf-8 (ie with the JSP directive). It's cool that Resin has a config parameter for this, but it will be obviated by setting the platform default - right, Scott? The main problem is that POSTed form data will be sent by the browser in whatever charset encoding was used on the host page, and this information is not sent along with the request. So the server must guess... and that usually means going with the platform default. If you for some reason need to manage multiple charsets in the same application, you'll need a Filter that executes early and calls request.setCharacterEncoding() *before* any code calls request.getParameter(). Jeff ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest