aspose file tools*
The moose likes Tomcat and the fly likes Garbage Chatacters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Garbage Chatacters" Watch "Garbage Chatacters" New topic
Author

Garbage Chatacters

Sameera Abeysekara Abeysekara
Greenhorn

Joined: Apr 10, 2007
Posts: 19
I write code to retrieves data from access database using ODBC connection but database contains Japanese characters.
when retrieve Japanese text and display using servlet(creating html) but Japanese character garbage.

then i solved this problem when i deployed in jbuilder bundled tomcat. i change language to Japaneses using regional settings then i created "USER DSN".
when i use jbuilder bundled tomcat its work properly(i mean show Japaneses text properly).

then i tried to deploy in side the i manually installed tomcat it doesn't work(i mean Japaneses characters garbaged).

how can i solve this problem.


thanks
sameera
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi Sameera,
In your servlet set the content type to UTF-8 for example something like this response.setContentType("text/html;charset=UTF-8").

Hope this helps.

Regards,
Sivaraman.L


Regards,
Sivaraman.L
Sameera Abeysekara Abeysekara
Greenhorn

Joined: Apr 10, 2007
Posts: 19
thanks for advice i already set the character set to UTF-8.
then how can i solve this problem?
do you have any ideas?

thanks
sameera
Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi,
Can you try this request.setCharacterEncoding("UTF-8"); in the init method of the servlet.
Sameera Abeysekara Abeysekara
Greenhorn

Joined: Apr 10, 2007
Posts: 19
We can't place that method in init() method.there is no request variable.

thanks
sameera
 
Consider Paul's rocket mass heater.
 
subject: Garbage Chatacters