tags:

views:

232

answers:

1

I wanted to send a page in ISO-8859-1 instead of UTF-8. The page is built with a JSP and some content retrieved by a CMS.

I tried to put this in the JSP, but the navigator stills performs the page in UTF-8.

grid.jsp:

    <%@page contentType="text/html; charset=iso-8859-1" 
      pageEncoding="iso-8859-1"%>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        </head>

What could be the problem?

Am I missing something?

A: 

The code is right:

<%@page contentType="text/html; charset=iso-8859-1" pageEncoding="iso-8859-1"%>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        </head>
    <html>

With this code you can ensure the page is in iso-8859-1 unless there is a filter that changes the response, it was my case.

Thanks!!

David García González
Only the `pageEncoding` was been enough. It will automatically (implicitly) also set the contenttype, charset and HTTP (meta) header.
BalusC