• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in setting character encoding in JSP

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am setting up character encoding in JSP dynamically using following meta tag:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<%=charset%>"

if charset value comes Big5 then it become
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Big5">

but browser is always showing contents in ASCII and not the encoding set by my JSP.
When I manually select View-->Encoding-->Chinese Traditional (Big5) in my Internet Explorer, it works.

Please help.

Thanks in advance,
Mina.
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe this will help

<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added following line in my jsp:

response.setContentType("text/html;charset"+scharset);


and now its working fine.


Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic