You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Chris Halverson <ch...@ncube.com> on 2001/05/25 21:42:04 UTC

Issues with Tomcat 3.2.1, JSPs and I18N ( Implicit character tran slation ??? )

I'm running Tomcat 3.2.1 on a Solaris box JDK 1.3
and using ECS1.4.1 for generating HTML

I can save CJKV characters to my back end Oracle db, retrieve them,
and display them if I'm using a servlet.  Doesn't matter whether I use ECS
or string handling.  The browser recognizes that I'm sending in UTF-8
encoding
and handles the characters just fine.

However when I use the same code to get the data from the DB and run it 
through a JSP page I get gobbledygook.

A couple of other factors
1.  Yes I'm setting the contentType to "text/html; charset=UTF-8" in the
Page Directiive
2.  Yes the browser is set to use the UTF-8 encoding.
2.  Yes I realize that the jsps are compiled into a servlet but while
looking at the jsp compiled java src file
     it appears that the servlet uses a specialized class JspWriter to
handle printing to the output stream.
3.  ECS had a similar issue in previous versions.  There are some tricky
issues with how streams are handled
     so that you don't run into implicit and screwy character encoding
issues.

I would appreciate any feedback, I'm going to dig through the Tomcat source
to see if I can find the root problem
and would hate to do that if there was an easy answer that I'm missing.

Thanks.
Chris Halverson

Christopher R. Halverson
nCube
chalvers@ncube.com
"Never underestimate the ability of any human to delude themselves,"
"and convince others their delusion is absolute"



Re: Issues with Tomcat 3.2.1, JSPs and I18N ( Implicit character tran slation ??? )

Posted by cm...@yahoo.com.
Hi Chris,

Can you reproduce this in normal JSP ( without oracle ) ? Can you send me
a small webapp where I can reproduce it ? Does it happens in 3.3 too ? 

I am trying to solve (most) I18N bugs and problems for 3.3, it's very
tricky but can be done :-) 


Costin 



On Fri, 25 May 2001, Chris Halverson wrote:

> I'm running Tomcat 3.2.1 on a Solaris box JDK 1.3
> and using ECS1.4.1 for generating HTML
> 
> I can save CJKV characters to my back end Oracle db, retrieve them,
> and display them if I'm using a servlet.  Doesn't matter whether I use ECS
> or string handling.  The browser recognizes that I'm sending in UTF-8
> encoding
> and handles the characters just fine.
> 
> However when I use the same code to get the data from the DB and run it 
> through a JSP page I get gobbledygook.
> 
> A couple of other factors
> 1.  Yes I'm setting the contentType to "text/html; charset=UTF-8" in the
> Page Directiive
> 2.  Yes the browser is set to use the UTF-8 encoding.
> 2.  Yes I realize that the jsps are compiled into a servlet but while
> looking at the jsp compiled java src file
>      it appears that the servlet uses a specialized class JspWriter to
> handle printing to the output stream.
> 3.  ECS had a similar issue in previous versions.  There are some tricky
> issues with how streams are handled
>      so that you don't run into implicit and screwy character encoding
> issues.
> 
> I would appreciate any feedback, I'm going to dig through the Tomcat source
> to see if I can find the root problem
> and would hate to do that if there was an easy answer that I'm missing.
> 
> Thanks.
> Chris Halverson
> 
> Christopher R. Halverson
> nCube
> chalvers@ncube.com
> "Never underestimate the ability of any human to delude themselves,"
> "and convince others their delusion is absolute"
> 
> 
> 


Re: Issues with Tomcat 3.2.1, JSPs and I18N ( Implicit character tran slation ??? )

Posted by Edmund Lai <ek...@yahoo.com>.
Are you using a servlet to load the jsp resource by
using a RequestDispatcher.include()? If so, setting
content-type in the page directive should have no
effect. This is an excerpt from the Servlet 2.2 API
doc 

"The included servlet cannot change the response
status code or set headers; any attempt to make a
change is ignored."

--
  Ed

> A couple of other factors
> 1.  Yes I'm setting the contentType to "text/html;
> charset=UTF-8" in the
> Page Directiive
> 2.  Yes the browser is set to use the UTF-8
> encoding.
> 2.  Yes I realize that the jsps are compiled into a
> servlet but while
> looking at the jsp compiled java src file
>      it appears that the servlet uses a specialized
> class JspWriter to
> handle printing to the output stream.
> 3.  ECS had a similar issue in previous versions. 
> There are some tricky
> issues with how streams are handled
>      so that you don't run into implicit and screwy
> character encoding
> issues.
> 
> I would appreciate any feedback, I'm going to dig
> through the Tomcat source
> to see if I can find the root problem
> and would hate to do that if there was an easy
> answer that I'm missing.
> 
> Thanks.
> Chris Halverson
> 
> Christopher R. Halverson
> nCube
> chalvers@ncube.com
> "Never underestimate the ability of any human to
> delude themselves,"
> "and convince others their delusion is absolute"
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/