tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick" <tomcat...@vidyah.com>
Subject RE: Q:how to remove charset from HTTP responce to allow browser use a browser selected charset?
Date Thu, 06 Oct 2005 20:55:05 GMT
Hi Mark,
  Can you talk a little about what the data is.. Just form data from
different locales?
I store all my data in UTF-8 and just instruct the page encoding to be the
same (UTF-8) and I'm able to handle input and display of whatever people
enter. Had a few odd things to overcome to get it working like,

JSP: I had to save the actual JSP file in UTF8 otherwise I couldn't get it
to serve the page with UTF8 properly.. This started after Tomcat 5.0.16 or
something like that.  

Servlet: don't think I had to do anything wild.. Just set the charset before
you do anything with the output stream, including just getting a handle to
the stream writer.  Set the contenttype first.
    response.setContentType("text/html;charset=UTF-8");

Depending on what you are reading from and such. You may also want to set
some Java ARGs when starting Tomcat... Like:
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
-DjavaEncoding=UTF-8

Not sure if this is relevant, but hope it helps,

Rick

-----Original Message-----
From: Mark [mailto:sendmailtomark@yahoo.com] 
Posted At: Thursday, October 06, 2005 12:13 PM
Posted To: Tomcat Dev
Conversation: Q:how to remove charset from HTTP responce to allow browser
use a browser selected charset?
Subject: Re: Q:how to remove charset from HTTP responce to allow browser use
a browser selected charset?


Hi Mark,
In my case servlet generates an output, so no JSP for now...
Can I do it using filters? Or define and store user's prefs with encoding
outside of tomcat and  in the session and use if it's exists in the session?

Thanks a lot!
Mark.

--- Mark Thomas <markt@apache.org> wrote:

> Mark wrote:
> > Hello,
> > 
> > In my application users enter data using different languages.
> > The problem I'm facing is the browser sets the page encoding
> always
> > to ISO-8859-1. (I guess this is default based on server OS)
> > 
> > User can change encoding on the page (Browser settings) and 
> > everything looks OK but only for one page. On the next page
> encoding
> > is back to ISO-8859-1.
> > Is there any way to instruct tomcat not to send the page
> encoding?
> 
> If you are using JSPs, no. The spec requires that the charset is set.
> 
> Mark
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 



	
		
______________________________________________________
Yahoo! for Good
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message