cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlad <g...@office.zssm.zp.ua>
Subject Re: cocoon1.8 shows russian text as ???? symbols in browser
Date Thu, 17 May 2001 08:18:13 GMT
Hi!

Thank you Konstantin.
And I did it via Cocoon.properties too.
My XML in UTF-8 and I changed in Cocoon.properties processor.xsp.encoding =
cp1251 to processor.xsp.encoding = UTF-8

and also I added
formatter.text/html.encoding = UTF-8
formatter.text/xml.encoding = UTF-8
formatter.text/wml.encoding = UTF-8
formatter.text/html/loose.encoding = UTF-8

in the end of
# Full configurable formatters
###############################

I can see russian text in the browser now too.

Vlad


"Piroumian, Konstantin" wrote:

> Simply move that code inside of your <page> element. If you place it after
> the <xsp:page> and before your root element then it will be class level
> logic and there is no response variable there.
>
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet href="test-to-html.xsl" type="text/xsl"?>
>
> <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>
>      <xsp:logic>
>        Date now = new Date();
>        String s = "Р│С├С┐Р│Р│Р╫";
>      </xsp:logic>
>
> <page>
> <!-- Here -->
>      <xsp:logic>
>        response.setContentType("text/html;charset=windows-1251");
>      </xsp:logic>
>
>  <title>This is my first xml</title>
>  <time>Текущее время(time) <xsp:expr>now</xsp:expr></time>
>  <rus>russian text - <xsp:expr>s</xsp:expr></rus>
>  <phoneline>
>   <title>Р│С├С┐Р│Р│Р╫</title>
>   <desc>This is the first paragraph of XML file</desc>
>  </phoneline>
> </page>
>
> </xsp:page>
>
> Also, don't forget to add meta tag in your stylesheet.
> Why don't you use a formatter for encoding? It will be better for several
> reasons.
>
> Kot.
>
> ----- Original Message -----
> From: "Vlad" <good@office.zssm.zp.ua>
> To: <cocoon-users@xml.apache.org>
> Sent: Thursday, May 17, 2001 10:54 AM
> Subject: Re: cocoon1.8 shows russian text as ???? symbols in browser
>
> Of course. This is the source of XML file
>
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet href="test-to-html.xsl" type="text/xsl"?>
>
> <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>
>      <xsp:logic>
>        response.setContentType("text/html;charset=windows-1251");
>      </xsp:logic>
>
>      <xsp:logic>
>        Date now = new Date();
>        String s = "Р│С├С┐Р│Р│Р╫";
>      </xsp:logic>
>
> <page>
>  <title>This is my first xml</title>
>  <time>Текущее время(time) <xsp:expr>now</xsp:expr></time>
>  <rus>russian text - <xsp:expr>s</xsp:expr></rus>
>  <phoneline>
>   <title>Р│С├С┐Р│Р│Р╫</title>
>   <desc>This is the first paragraph of XML file</desc>
>  </phoneline>
> </page>
>
> </xsp:page>
>
> Vlad
>
> "Piroumian, Konstantin" wrote:
>
> > > Yes I did so but XSP compiler gives a mistake:
> > >
> > > java.lang.Exception: XSP Java Compiler: Compilation failed for
> _test.java
> > >     25: Type expected.
> > >
> > >            response.setContentType("text/html;charset=windows-1251");
> > >
> > >                                    ^
> > >     1 error
> >
> > Strange... I use it without problems. Could you send me your source?
> >
> > Konstantin.
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message