I may be out of date, last time I used JSPs was in 2005 or so.
Back then the default assumed page encoding was *ISO-8859-1*., not the same
as contentType.
The spec (JSP 1.2)
http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.pdf
also indicated that (near the top of page 18.

JSP 2.0 also indicates the same:
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2010.html#1001361

-Knut


On Wed, Jul 29, 2009 at 14:41, Scott Ferguson <f...@caucho.com> wrote:

> The charset in the contentType is the default value of the
> pageEncoding.  So it shouldn't matter.
>
> You can check the parsing, by the way, by looking at the generated
> *.java file.  Those characters will be the parsed unicode values.
>
> -- Scott
>
>
> On Jul 29, 2009, at 2:27 PM, Rick Mann wrote:
>
> > Gah! Thank you! I feel like I should've known this, or did know it
> > once upon a time and just forgot.
> >
> > On Jul 29, 2009, at 14:23:03, Knut Forkalsrud wrote:
> >
> >> Try adding either of these:
> >>
> >> <%@ page pageEncoding="ISO-8859-1" %>
> >> <%@ page pageEncoding="UTF-8" %>
> >>
> >> One of them might do the trick
> >>
> >> -Knut
> >>
> >>
> >>
> >> <%@ page
> >> [ language="java" ]
> >> [ extends="package.class" ]
> >> [ import="{package.class | package.*}, ..." ]
> >> [ session="true|false" ]
> >> [ buffer="none|8kb|sizekb" ]
> >> [ autoFlush="true|false" ]
> >> [ isThreadSafe="true|false" ]
> >> [ info="text" ]
> >> [ errorPage="relativeURL" ]
> >> [ contentType="mimeType [ ; charset=characterSet ]" |
> >> "text/html ; charset=ISO-8859-1" ]
> >> [ isErrorPage="true|false" ]
> >> [ pageEncoding="characterSet |ISO-8859-1" ]
> >> %>
> >>
> >>
> >> On Wed, Jul 29, 2009 at 14:06, Rick Mann <rm...@latencyzero.com>
> >> wrote:
> >> So, I created two dirt-simple files, identical in content, one ending
> >> in .jsp, one ending in .html. I have no filters or other processing
> >> in
> >> my webapp. Resin 4.0 seems to re-encode the UTF-8 copyright symbol,
> >> and I get four bytes "C3 82 C2 A9", when I should have two: "C2 A9",
> >> but ony in the .jsp, not in the .html.
> >>
> >> I figure at some point a conversion is happening where something is
> >> having the wrong encoding applied.
> >>
> >> Any suggestions?
> >>
> >>
> >> On Jul 28, 2009, at 18:19:24, Rick Mann wrote:
> >>
> >>> I'm running Resin 4.0 on Mac OS X. I have a .jsp file encoded as
> >>> UTF-8, and I pass -Dfile.encoding=utf-8 to the jvm. At the top of my
> >>> JSPs, I have
> >>>
> >>> <%@ page contentType="application/xhtml+xml; charset=UTF-8"%>
> >>>
> >>> I've verified that the JSP thinks the request and response encodings
> >>> are UTF-8 with:
> >>>
> >>> <%
> >>>
> >> org.apache.log4j.Logger.getLogger("com.latencyzero").warn("Encoding:
> >>> "+ request.getCharacterEncoding());
> >>>
> >> org.apache.log4j.Logger.getLogger("com.latencyzero").warn("resp
> >>> Encoding: "+ response.getCharacterEncoding());
> >>> %>
> >>>
> >>> But, the copyright symbol in my source file, which looks fine in my
> >>> UTF-8 aware text editor, renders as a capital A with a grave accent,
> >>> and the copyright symbol.
> >>>
> >>> What aspect of the encoding am I forgetting?
> >>>
> >>> TIA,
> >>> Rick
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> resin-interest mailing list
> >>> resin-interest@caucho.com
> >>> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >>
> >>
> >> _______________________________________________
> >> resin-interest mailing list
> >> resin-interest@caucho.com
> >> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >> _______________________________________________
> >> resin-interest mailing list
> >> resin-interest@caucho.com
> >> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >
> >
> >
> > _______________________________________________
> > resin-interest mailing list
> > resin-interest@caucho.com
> > http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to