This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes cannot use utf-8 to store utf-8 character, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "cannot use utf-8 to store utf-8 character, please help" Watch "cannot use utf-8 to store utf-8 character, please help" New topic
Author

cannot use utf-8 to store utf-8 character, please help

sun_guoqiao
Greenhorn

Joined: Jul 17, 2001
Posts: 4
Dear all:
I am using mySQL to store some Chinese character, which is submitted from html form. My problem is:
When I use <meta http-equiv=Content-Type content="text/html; charset=utf-8"> in jsp file, the Chinese character can be saved into database correctly and also can be retrieved and displayed correctly later time.
When I added <%@ page contentType='text/html; charset=utf-8' %> into the jsp file, the Chinese character cannot be saved and displayed correctly.
Can anyone kindly give me some hint why? Thx.
==========================================================

I need to use <%@ page contentType='text/html; charset=utf-8' %> in the jsp file in order to display i18n properties file content.
Thanks for your time!
guoqiao
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Welcome to the Ranch "sun_guoqiao"!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JSP Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: cannot use utf-8 to store utf-8 character, please help
 
Similar Threads
The function of sRequest in JSP
Problem while storing Japanese characters in Oracle 9i
Turkish Character Problem in Properties Files
saving chinese data to text file
struts with character encoding problem