tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Migrating to tomcat 6 gives formatted currency amounts problem
Date Fri, 12 Sep 2008 19:52:23 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johnny,

Johnny Kewl wrote:
> Servlet Response does in fact have a setLocale(Locale loc) function...
> Which seems to indicate that if headers or something like
> response.setContentType("text/html;charset=UTF-8");
> is *not* used... TC will take on the encoding(ha ha did it again)
> charset of that locale...

Nope! Locale != charset. Locale does not even hint of a /preferred/ charset.

> I find thinking outside of HTTP headers difficult... and it seems that
> servlet spec has recognized the conflict inherent in locale and http
> header.
> It seems that prior to Servlet spec 2.4 if a coder used locale dependent
> JSTL to access resource bundles... that would in fact override
> setContentType.... this apparently is no longer the case... the header
> takes pref...

Well, the header comes from the encoding set on the response, so it
should all be the same.

> I think you just got to put on a different hat when doing Swing and Web
> internationalization...

You shouldn't have to. The only difference is the character encoding for
the requests and responses. The use of the Java API should be identical.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjKyHcACgkQ9CaO5/Lv0PDxDQCfazFHZjh/amrJBOkauDCFmwN0
rQoAoLYmA3A8Y6hbhaMN3dNeJckoy2YV
=4bXQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message