File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Auto-dectect character encoding in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Auto-dectect character encoding in JSP" Watch "Auto-dectect character encoding in JSP" New topic

Auto-dectect character encoding in JSP

ying lam
Ranch Hand

Joined: May 17, 2004
Posts: 85
can you please tell me what do I need to do so that my JSP can enable auto-detect on the browser? (I have load some popular site to make sure my
browser is already auto-detect character encoding).

I have put these in my jsp, but it still does not auto dectect the character encoding.

<%@page contentType="text/html; charset=UTF-8"%>

<meta http-equiv="pragma" content="nocache"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

Thank for any help.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The HTML page can't do anything to enable browser features. But it shouldn't need to, because if the encoding is specifically stated as in your example, then there is no need for auto-detection. If you do that, does the browser still use UTF-8 to interpret the page?
I agree. Here's the link:
subject: Auto-dectect character encoding in JSP
It's not a secret anymore!