How to change the encoding in JSP?

A

Ahan Hsieh

Dear All:
Supposed I have two client system one is BIG5 and another is GB, and I have
one web application written by JSP (using BIG5 style code), and when my big5
browser
to request the application, it show the exact big5 information, but my
another GB browser
it will show the wrong message even I change encoding in browser to GB.
If I want to show the GB information in GB browser, how do I change in the
big5
application written by JSP.

Regards. Ahan
 
M

Manish Jethani

Ahan said:
Supposed I have two client system one is BIG5 and another is GB, and I have
one web application written by JSP (using BIG5 style code), and when my big5
browser
to request the application, it show the exact big5 information, but my
another GB browser
it will show the wrong message even I change encoding in browser to GB.
If I want to show the GB information in GB browser, how do I change in the
big5
application written by JSP.

Specify the encoding in the HTTP response. In a JSP, you can
set this at the beginning:

<%@ page contentType="text/html; charset=cn-gb" %>

Look here for more information:

http://www.zvon.org/tmRFC/RFC1922/Output/chapter3.html

-Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,117
Latest member
Matilda564
Top