Ok I've found the solution ! The problem is not in jspc, its when I compile the .java file generated by jspc with javac !
I've look into Tomcat source code (org.apache.jasper.compiler.Compiler) and I realized that they don't compile using the default encoding instead they use "UTF-8" (javac -encoding UTF-8 ...) ! Not it works !!! Thanks to everyone for your help ! Christian ----- Original Message ----- From: "Christian Bourque" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Thursday, April 11, 2002 10:31 AM Subject: Re: Jspc & i18n > Jeff, > > If I precompile my jsp file with this option : > > <%@ page contentType="text/html;charset=UTF-8" %> > > I get this error : > > JspReader: Exception parsing file \index.jsp > sun.io.MalformedInputException > at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:110) > at java.io.InputStreamReader.convertInto(InputStreamReader.java:137) > at java.io.InputStreamReader.fill(InputStreamReader.java:186) > at java.io.InputStreamReader.read(InputStreamReader.java:249) > at java.io.Reader.read(Reader.java:102) > at org.apache.jasper.compiler.JspReader.pushFile(JspReader.java:224) > at org.apache.jasper.compiler.JspReader.pushFile(JspReader.java:164) > at org.apache.jasper.compiler.JspReader.<init>(JspReader.java:282) > at > org.apache.jasper.compiler.JspReader.createJspReader(JspReader.java:288) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:167) > at org.apache.jasper.JspC.parseFile(JspC.java:376) > at org.apache.jasper.JspC.parseFiles(JspC.java:641) > at org.apache.jasper.JspC.main(JspC.java:689) > > You were right about changing the encoding directly in the browser, it works > when I switch to UTF-8 ! > > But I still don't understand why it works if I deploy the same page directly > in Tomcat (without precompilation) ??? > > What is the difference ? It should be the same thing ! > > Christian > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "Tomcat Users List" <[EMAIL PROTECTED]> > Sent: Thursday, April 11, 2002 9:30 AM > Subject: Re: Jspc & i18n > > > > It looks like the output is probably in UTF-8 format. If you use the <%@ > page > contentType="text/html;charset=UTF-8" %> directive in your page, that should > instruct the browser to use that encoding for display. To see if this > should > work, you should be able to just manually change your browser's encoding to > UTF-8 (Unicode) while viewing the page that currently doesn't work and have > it > display properly for you. > > HTH, > Jeff > > > > > "Christian > Bourque" To: "Tomcat Users List" > <[EMAIL PROTECTED]> > <christian@ali cc: > osoft.com> Subject: Re: Jspc & i18n > > 04/10/02 04:57 > PM > Please respond > to "Tomcat > Users List" > > > > > > > Hi Jeff ! > > I can't use the attribute "encoding", I think my app server doesn't > implements the last JSP specs ! > > But I have an update to my problem, I did a diff on two different .java file > based on the same jsp file : > > 1) the one generated by using jspc command line (the one that doesn't works) > 2) the one generated by tomcat/jspc when accessed the first time by a > browser (the one that works) > > Its really weird because there are almost identical (only the class name is > different but this is normal), the french text is scrambled in both versions > ! > > Even more weird, if I access the command line generated version page (#1) in > IE I see this : > > Joyeux noël et bonne année !!! > > But if I do a view source of the page look at this : > > Joyeux no�l et bonne ann�e !!! > > Everything is fine !!!!!! > > Christian > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "Tomcat Users List" <[EMAIL PROTECTED]> > Sent: Wednesday, April 10, 2002 4:55 PM > Subject: Re: Jspc & i18n > > > > Hi, Christian. > > I haven't run into this problem before, so I'm not sure, but it looks > like the compiler is encoding the accented characters. Perhaps if you > specify > the JSP page's encoding, it won't do that anymore...? Try using a directive > at the top of your JSP to do this, something like <%@ page encoding > ="ISO-8859-1" %> or whatever specific encoding/character set you are using. > > HTH, > -Jeff > > > > > "Christian > Bourque" To: "Tomcat Users List" > <[EMAIL PROTECTED]> > <christian@ali cc: > osoft.com> Subject: Re: Jspc & i18n > > 04/10/02 02:16 > PM > Please respond > to "Tomcat > Users List" > > > > > > > Hi Jay ! > > No, the bad characters are in the .java files that jspc creates ! > > The text is clean in the .jsp file but as soon as I convert it to .java with > jspc all french accent are scrambled ! > > Christian > > ----- Original Message ----- > From: "Jay Gardner" <[EMAIL PROTECTED]> > To: "Tomcat Users List" <[EMAIL PROTECTED]> > Sent: Wednesday, April 10, 2002 2:42 PM > Subject: RE: Jspc & i18n > > > > Are all the correct characters in the .java files that jspc creates? > > > > --Jay Gardner > > > > -----Original Message----- > > From: Christian Bourque [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, April 10, 2002 12:49 PM > > To: Tomcat Users List > > Subject: Jspc & i18n > > > > Hi ! > > > > I'm having a weird problem with JSPC. We have a bilingual web application > > (english/french), so when I pre-compile all my jsp pages the ones which > > contains french accent are all screwed up : > > > > Vous avez oubli� votre mot de passe ? = Vous avez oubli�(c) votre mot de > > passe > > ? > > cha�ne = cha�(r)ne > > > > ??? > > > > Christian > > > > > > > > -- > > To unsubscribe: <mailto:[EMAIL PROTECTED]> > > For additional commands: <mailto:[EMAIL PROTECTED]> > > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe: <mailto:[EMAIL PROTECTED]> > > For additional commands: <mailto:[EMAIL PROTECTED]> > > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
