Yeah, I had problems with UTF-8 as well. Know what? It worked after I
changed it to charset=UTF8 (without the dash). So I have this page:
<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0 Transitional//EN">
<%@ page contentType="text/html; charset=UTF8" %>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset="UTF8">
</HEAD>
<BODY>
<%= new String ( "\u00EF" ) %>
</BODY>
</HTML>
Note that the META tag also works with "UTF-8", and that without the META
tag the browser does not display the page as unicode.
Stefan
--
Stefan van den Oord
[EMAIL PROTECTED]
> From: McArthur Rob <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 15 Mar 2000 08:53:05 -0500
> To: [EMAIL PROTECTED]
> Subject: FW: JRun, JSP, forms and character sets
>
> The listserv seems a little wonky - I didn't see my message come up, so I'm
> posting this a second time
>> Hello all,
>>
>> Perhaps someone has encountered this problem before:
>>
>> I need to receive a form submit into a JSP page where the encoding
>> character-set is not necessarily ISO-8859-1. I built a sample form with a
>> JSP page with <%@ page contentType="text/html; charset=UTF-8" %>. The
>> form does a GET (so I can see the parameters on the URL) and seems to
>> encode the input correctly into UTF-8, but when I retrieve the parameters,
>> they are converted incorrectly. As an experiment, I had the page display
>> request.getCharacterEncoding() and it always reports ISO-8859-1, which
>> would explain the incorrect translation. I am starting to suspect that
>> JRun's Request object ignores the Content-Type HTTP header from the form's
>> submit.
>>
>> Anyone else experienced this and have a solution?
>>
>> Rob McArthur
>>
>> Here is the test page (inputtest.jsp):
>>
>> <%@ page contentType="text/html; charset=UTF-8" session="false"%>
>> <H1>UTF-8 Input Test</H1>
>> <%
>> String input = request.getParameter("input");
>> if (input != null)
>> {
>> %>
>> Input received: <%= input %><BR />
>> <BR />
>> <% }
>> else
>> input = "";
>> %>
>> <FORM NAME="test" METHOD="GET" ACTION="inputtest.jsp" >
>> Type some text: <INPUT TYPE="textarea" NAME="input" VALUE="<%= input
>> %>"><BR />
>> <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit"><BR />
>> </FORM>
>> Request character encoding: <%= request.getCharacterEncoding() %><BR />
>> Request content type: <%= request.getContentType() %><BR />
>> Response character encoding: <%= response.getCharacterEncoding() %>
>>
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets