You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by yuryx <yu...@mobicomk.donpac.ru> on 2002/02/07 17:50:01 UTC

JSPGenerator encoding problem

Hello all!

I have following problem.
JSPGenerator doesn't normally encoding non english  characters.
Simple sample:
sample.jsp:
<%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
<%@ page language="java" 
import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>

<page>
    <content>
        <%out.println("<para>привет!</para>");%>
    </content>
</page>

sample.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                xmlns:xsp-request="http://apache.org/xsp/request/2.0"

  <xsl:template match="page">
   <html>
    <head>
     <title>
      <xsl:value-of select="title"/>
     </title>
    </head>
    <body bgcolor="white" alink="red" link="blue" vlink="blue">
     <xsl:apply-templates/>
    </body>
   </html>
  </xsl:template>
   
  <xsl:template match="para">
    <b><xsl:value-of select="."/></b>
  </xsl:template>
</xsl:stylesheet>

I have following  line in sitemap:
<map:generator name="jsp"  
src="org.apache.cocoon.generation.JspGenerator" 
logger="sitemap.generator.jsp" label="content,data">
    <encoding>KOI8-R</encoding>
</map:generator>
...and...
   <map:match pattern="sample-jsp">
     <map:generate type="jsp" src="/statesql/sample.jsp"/>
     <map:transform src="statesql/sample.xsl"/>
     <map:serialize type="html"/>
    </map:match>   

After generation I have next:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body vlink="blue" link="blue" alink="red" bgcolor="white">
<content>
???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b>	???
</content>    
</body>
</html>



Can anyone help me?
Thanx
Yury



---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by yuryx <yu...@mobicomk.donpac.ru>.
Hi Peter!
I try your recomendation
but it don't  solved my problem :(
Encoding problem in Generator , or, maybe, in jasper compiller...
Yury
Peter Schwenke wrote:

>Hi Yury,
>
>Have you tried 
>
>
>  <map:serializers default="html">
>   <map:serializer name="links"                               src="org.apache.cocoon.serialization.LinkSerializer"/>
>   <map:serializer name="xml"    mime-type="text/xml"         src="org.apache.cocoon.serialization.XMLSerializer"
>                   pool-max="32" pool-min="16" pool-grow="4"/>
>   <map:serializer name="html"   mime-type="text/html"        src="org.apache.cocoon.serialization.HTMLSerializer">
>   <encoding>koi8-r</encoding>   <---- That is, put the koi8-r encoding here
>   </map:serializer>
>
>
>                                                               ...Peter
>                                         
>yuryx writes:
> > Without transformation I have
> > 
> > <page>
> >     
> > <content>
> >     
> > <para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>
> > 
> >     
> > </content>    
> > 
> > </page>
> > 
> > Problem with generation, I know...
> > 
> > Piroumian, Konstantin wrote:
> > 
> > >Is it the problem of JSPGenerator or maybe this happens during
> > >transformation or serialization? Try to remove the transformer from the
> > >pipeline or replace JSPGenerator with FileGenerator and use static content
> > >in KOI8-r to find out what is the cause of the problem.
> > >
> > >Regards,
> > >    Konstantin Piroumian
> > >
> > >----- Original Message -----
> > >From: "yuryx" <yu...@mobicomk.donpac.ru>
> > >To: <co...@xml.apache.org>
> > >Sent: Thursday, February 07, 2002 7:50 PM
> > >Subject: JSPGenerator encoding problem
> > >
> > >
> > >Hello all!
> > >
> > >I have following problem.
> > >JSPGenerator doesn't normally encoding non english  characters.
> > >Simple sample:
> > >sample.jsp:
> > ><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
> > ><%@ page language="java"
> > >import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
> > >
> > ><page>
> > >    <content>
> > >        <%out.println("<para>привет!</para>");%>
> > >    </content>
> > ></page>
> > >
> > >sample.xsl:
> > ><?xml version="1.0"?>
> > ><xsl:stylesheet version="1.0"
> > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > >                xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> > >
> > >  <xsl:template match="page">
> > >   <html>
> > >    <head>
> > >     <title>
> > >      <xsl:value-of select="title"/>
> > >     </title>
> > >    </head>
> > >    <body bgcolor="white" alink="red" link="blue" vlink="blue">
> > >     <xsl:apply-templates/>
> > >    </body>
> > >   </html>
> > >  </xsl:template>
> > >
> > >  <xsl:template match="para">
> > >    <b><xsl:value-of select="."/></b>
> > >  </xsl:template>
> > ></xsl:stylesheet>
> > >
> > >I have following  line in sitemap:
> > ><map:generator name="jsp"
> > >src="org.apache.cocoon.generation.JspGenerator"
> > >logger="sitemap.generator.jsp" label="content,data">
> > >    <encoding>KOI8-R</encoding>
> > ></map:generator>
> > >...and...
> > >   <map:match pattern="sample-jsp">
> > >     <map:generate type="jsp" src="/statesql/sample.jsp"/>
> > >     <map:transform src="statesql/sample.xsl"/>
> > >     <map:serialize type="html"/>
> > >    </map:match>
> > >
> > >After generation I have next:
> > >
> > ><html>
> > ><head>
> > ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> > ><title></title>
> > ></head>
> > ><body vlink="blue" link="blue" alink="red" bgcolor="white">
> > ><content>
> > >???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
> > ></content>
> > ></body>
> > ></html>
> > >
> > >
> > >
> > >Can anyone help me?
> > >Thanx
> > >Yury
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >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: <co...@xml.apache.org>
> > >For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> > >For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by yuryx <yu...@mobicomk.donpac.ru>.
Piroumian, Konstantin wrote:

>Another idea:
>
><%@ page language="java" encoding="koi8-r"%>
>
Hi Konstantin!
with this idea I have next exception
/org.apache.cocoon.ProcessingException: ServletException in 
JspGenerator.generate()/

>
>
>or something like
>
><%@ page language="java" %>
><% response.setContentType("text/xml; charset=KOI8-r"); %>
>
>If you can send your JSP page to me I can take a look at it.
>
My simple jsp page:
<?xml version='1.0' encoding="KOI8-R"?>
<%@ page language="java" 
import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>

<page>
    <content>
    <%
    out.println("<para>������!</para>");
    %>
    </content>   
</page>

>
>
>----- Original Message -----
>From: "yuryx" <yu...@mobicomk.donpac.ru>
>To: <co...@xml.apache.org>
>Sent: Friday, February 08, 2002 9:46 AM
>Subject: Re: JSPGenerator encoding problem
>
>
>Thanx for ideas ,Vadim.
>But I can't undestand how declare JSP encoding.
>
>instead of <%out.println("<?xml version='1.0' encoding='koi8-r'?>");%> I try
><?xml version='1.0' encoding='KOI8-R'?> in sample.jsp
>but again it doesn't work :(
>Yury
>
>Vadim Gritsenko wrote:
>
>>Your JSP is not valid. It does not declares JSP encoding as it should.
>>Obviously JSP runtime is unable to read characters correctly.
>>
>>Regards,
>>Vadim
>>
>>>-----Original Message-----
>>>From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
>>>Sent: Thursday, February 07, 2002 1:06 PM
>>>To: cocoon-users@xml.apache.org
>>>Subject: Re: JSPGenerator encoding problem
>>>
>>>Without transformation I have
>>>
>>><page>
>>>
>>><content>
>>>
>>><para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>
>>>
>>>
>>></content>
>>>
>>></page>
>>>
>>>Problem with generation, I know...
>>>
>>>Piroumian, Konstantin wrote:
>>>
>>>>Is it the problem of JSPGenerator or maybe this happens during
>>>>transformation or serialization? Try to remove the transformer from
>>>>
>>the
>>
>>>>pipeline or replace JSPGenerator with FileGenerator and use static
>>>>
>>content
>>
>>>>in KOI8-r to find out what is the cause of the problem.
>>>>
>>>>Regards,
>>>>  Konstantin Piroumian
>>>>
>>>>----- Original Message -----
>>>>From: "yuryx" <yu...@mobicomk.donpac.ru>
>>>>To: <co...@xml.apache.org>
>>>>Sent: Thursday, February 07, 2002 7:50 PM
>>>>Subject: JSPGenerator encoding problem
>>>>
>>>>
>>>>Hello all!
>>>>
>>>>I have following problem.
>>>>JSPGenerator doesn't normally encoding non english  characters.
>>>>Simple sample:
>>>>sample.jsp:
>>>><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
>>>><%@ page language="java"
>>>>import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
>>>>
>>>><page>
>>>>  <content>
>>>>      <%out.println("<para>������!</para>");%>
>>>>  </content>
>>>></page>
>>>>
>>>>sample.xsl:
>>>><?xml version="1.0"?>
>>>><xsl:stylesheet version="1.0"
>>>>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>>              xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>>>
>>>><xsl:template match="page">
>>>> <html>
>>>>  <head>
>>>>   <title>
>>>>    <xsl:value-of select="title"/>
>>>>   </title>
>>>>  </head>
>>>>  <body bgcolor="white" alink="red" link="blue" vlink="blue">
>>>>   <xsl:apply-templates/>
>>>>  </body>
>>>> </html>
>>>></xsl:template>
>>>>
>>>><xsl:template match="para">
>>>>  <b><xsl:value-of select="."/></b>
>>>></xsl:template>
>>>></xsl:stylesheet>
>>>>
>>>>I have following  line in sitemap:
>>>><map:generator name="jsp"
>>>>src="org.apache.cocoon.generation.JspGenerator"
>>>>logger="sitemap.generator.jsp" label="content,data">
>>>>  <encoding>KOI8-R</encoding>
>>>></map:generator>
>>>>...and...
>>>> <map:match pattern="sample-jsp">
>>>>   <map:generate type="jsp" src="/statesql/sample.jsp"/>
>>>>   <map:transform src="statesql/sample.xsl"/>
>>>>   <map:serialize type="html"/>
>>>>  </map:match>
>>>>
>>>>After generation I have next:
>>>>
>>>><html>
>>>><head>
>>>><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>>>><title></title>
>>>></head>
>>>><body vlink="blue" link="blue" alink="red" bgcolor="white">
>>>><content>
>>>>???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
>>>></content>
>>>></body>
>>>></html>
>>>>
>>>>
>>>>
>>>>Can anyone help me?
>>>>Thanx
>>>>Yury
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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: <co...@xml.apache.org>
>>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>



Re: JSPGenerator encoding problem

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Another idea:

<%@ page language="java" encoding="koi8-r"%>

or something like

<%@ page language="java" %>
<% response.setContentType("text/xml; charset=KOI8-r"); %>

If you can send your JSP page to me I can take a look at it.

----- Original Message -----
From: "yuryx" <yu...@mobicomk.donpac.ru>
To: <co...@xml.apache.org>
Sent: Friday, February 08, 2002 9:46 AM
Subject: Re: JSPGenerator encoding problem


Thanx for ideas ,Vadim.
But I can't undestand how declare JSP encoding.

instead of <%out.println("<?xml version='1.0' encoding='koi8-r'?>");%> I try
<?xml version='1.0' encoding='KOI8-R'?> in sample.jsp
but again it doesn't work :(
Yury

Vadim Gritsenko wrote:

>Your JSP is not valid. It does not declares JSP encoding as it should.
>Obviously JSP runtime is unable to read characters correctly.
>
>Regards,
>Vadim
>
>>-----Original Message-----
>>From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
>>Sent: Thursday, February 07, 2002 1:06 PM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: JSPGenerator encoding problem
>>
>>Without transformation I have
>>
>><page>
>>
>><content>
>>
>><para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>
>>
>>
>></content>
>>
>></page>
>>
>>Problem with generation, I know...
>>
>>Piroumian, Konstantin wrote:
>>
>>>Is it the problem of JSPGenerator or maybe this happens during
>>>transformation or serialization? Try to remove the transformer from
>>>
>the
>
>>>pipeline or replace JSPGenerator with FileGenerator and use static
>>>
>content
>
>>>in KOI8-r to find out what is the cause of the problem.
>>>
>>>Regards,
>>>   Konstantin Piroumian
>>>
>>>----- Original Message -----
>>>From: "yuryx" <yu...@mobicomk.donpac.ru>
>>>To: <co...@xml.apache.org>
>>>Sent: Thursday, February 07, 2002 7:50 PM
>>>Subject: JSPGenerator encoding problem
>>>
>>>
>>>Hello all!
>>>
>>>I have following problem.
>>>JSPGenerator doesn't normally encoding non english  characters.
>>>Simple sample:
>>>sample.jsp:
>>><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
>>><%@ page language="java"
>>>import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
>>>
>>><page>
>>>   <content>
>>>       <%out.println("<para>привет!</para>");%>
>>>   </content>
>>></page>
>>>
>>>sample.xsl:
>>><?xml version="1.0"?>
>>><xsl:stylesheet version="1.0"
>>>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>               xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>>
>>> <xsl:template match="page">
>>>  <html>
>>>   <head>
>>>    <title>
>>>     <xsl:value-of select="title"/>
>>>    </title>
>>>   </head>
>>>   <body bgcolor="white" alink="red" link="blue" vlink="blue">
>>>    <xsl:apply-templates/>
>>>   </body>
>>>  </html>
>>> </xsl:template>
>>>
>>> <xsl:template match="para">
>>>   <b><xsl:value-of select="."/></b>
>>> </xsl:template>
>>></xsl:stylesheet>
>>>
>>>I have following  line in sitemap:
>>><map:generator name="jsp"
>>>src="org.apache.cocoon.generation.JspGenerator"
>>>logger="sitemap.generator.jsp" label="content,data">
>>>   <encoding>KOI8-R</encoding>
>>></map:generator>
>>>...and...
>>>  <map:match pattern="sample-jsp">
>>>    <map:generate type="jsp" src="/statesql/sample.jsp"/>
>>>    <map:transform src="statesql/sample.xsl"/>
>>>    <map:serialize type="html"/>
>>>   </map:match>
>>>
>>>After generation I have next:
>>>
>>><html>
>>><head>
>>><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>>><title></title>
>>></head>
>>><body vlink="blue" link="blue" alink="red" bgcolor="white">
>>><content>
>>>???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
>>></content>
>>></body>
>>></html>
>>>
>>>
>>>
>>>Can anyone help me?
>>>Thanx
>>>Yury
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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: <co...@xml.apache.org>
>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
> > From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
> >
> > Thanx for ideas ,Vadim.
> > But I can't undestand how declare JSP encoding.
>
> Try to read JSP specification.

The correct declaration is:

<%@ page language="java" import="java.text.SimpleDateFormat,java.util.*"
pageEncoding="KOI8-R"%><?xml version='1.0' encoding="KOI8-R"?>

Note, that your XML to be parsed you should put <?xml ...?> declaration on
the same line as <%@ page ...>, otherwise an empty line is added at the
beginning of the page and this causes parsing error.

Regards,
    Konstantin

P.S. I've already sent the corrected file off-list.

>
> Vadim
>
>
> > instead of <%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
> I try
> > <?xml version='1.0' encoding='KOI8-R'?> in sample.jsp
> > but again it doesn't work :(
> > Yury
> >
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: JSPGenerator encoding problem

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
> 
> Thanx for ideas ,Vadim.
> But I can't undestand how declare JSP encoding.

Try to read JSP specification.

Vadim


> instead of <%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
I try
> <?xml version='1.0' encoding='KOI8-R'?> in sample.jsp
> but again it doesn't work :(
> Yury
> 


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by yuryx <yu...@mobicomk.donpac.ru>.
Thanx for ideas ,Vadim.
But I can't undestand how declare JSP encoding.

instead of <%out.println("<?xml version='1.0' encoding='koi8-r'?>");%> I try 
<?xml version='1.0' encoding='KOI8-R'?> in sample.jsp
but again it doesn't work :(
Yury

Vadim Gritsenko wrote:

>Your JSP is not valid. It does not declares JSP encoding as it should.
>Obviously JSP runtime is unable to read characters correctly.
>
>Regards,
>Vadim
>
>>-----Original Message-----
>>From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
>>Sent: Thursday, February 07, 2002 1:06 PM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: JSPGenerator encoding problem
>>
>>Without transformation I have
>>
>><page>
>>
>><content>
>>
>><para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>
>>
>>
>></content>
>>
>></page>
>>
>>Problem with generation, I know...
>>
>>Piroumian, Konstantin wrote:
>>
>>>Is it the problem of JSPGenerator or maybe this happens during
>>>transformation or serialization? Try to remove the transformer from
>>>
>the
>
>>>pipeline or replace JSPGenerator with FileGenerator and use static
>>>
>content
>
>>>in KOI8-r to find out what is the cause of the problem.
>>>
>>>Regards,
>>>   Konstantin Piroumian
>>>
>>>----- Original Message -----
>>>From: "yuryx" <yu...@mobicomk.donpac.ru>
>>>To: <co...@xml.apache.org>
>>>Sent: Thursday, February 07, 2002 7:50 PM
>>>Subject: JSPGenerator encoding problem
>>>
>>>
>>>Hello all!
>>>
>>>I have following problem.
>>>JSPGenerator doesn't normally encoding non english  characters.
>>>Simple sample:
>>>sample.jsp:
>>><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
>>><%@ page language="java"
>>>import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
>>>
>>><page>
>>>   <content>
>>>       <%out.println("<para>привет!</para>");%>
>>>   </content>
>>></page>
>>>
>>>sample.xsl:
>>><?xml version="1.0"?>
>>><xsl:stylesheet version="1.0"
>>>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>               xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>>
>>> <xsl:template match="page">
>>>  <html>
>>>   <head>
>>>    <title>
>>>     <xsl:value-of select="title"/>
>>>    </title>
>>>   </head>
>>>   <body bgcolor="white" alink="red" link="blue" vlink="blue">
>>>    <xsl:apply-templates/>
>>>   </body>
>>>  </html>
>>> </xsl:template>
>>>
>>> <xsl:template match="para">
>>>   <b><xsl:value-of select="."/></b>
>>> </xsl:template>
>>></xsl:stylesheet>
>>>
>>>I have following  line in sitemap:
>>><map:generator name="jsp"
>>>src="org.apache.cocoon.generation.JspGenerator"
>>>logger="sitemap.generator.jsp" label="content,data">
>>>   <encoding>KOI8-R</encoding>
>>></map:generator>
>>>...and...
>>>  <map:match pattern="sample-jsp">
>>>    <map:generate type="jsp" src="/statesql/sample.jsp"/>
>>>    <map:transform src="statesql/sample.xsl"/>
>>>    <map:serialize type="html"/>
>>>   </map:match>
>>>
>>>After generation I have next:
>>>
>>><html>
>>><head>
>>><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>>><title></title>
>>></head>
>>><body vlink="blue" link="blue" alink="red" bgcolor="white">
>>><content>
>>>???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
>>></content>
>>></body>
>>></html>
>>>
>>>
>>>
>>>Can anyone help me?
>>>Thanx
>>>Yury
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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: <co...@xml.apache.org>
>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: JSPGenerator encoding problem

Posted by Vadim Gritsenko <va...@verizon.net>.
Your JSP is not valid. It does not declares JSP encoding as it should.
Obviously JSP runtime is unable to read characters correctly.

Regards,
Vadim

> -----Original Message-----
> From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
> Sent: Thursday, February 07, 2002 1:06 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: JSPGenerator encoding problem
> 
> Without transformation I have
> 
> <page>
> 
> <content>
> 
> <para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>
> 
> 
> </content>
> 
> </page>
> 
> Problem with generation, I know...
> 
> Piroumian, Konstantin wrote:
> 
> >Is it the problem of JSPGenerator or maybe this happens during
> >transformation or serialization? Try to remove the transformer from
the
> >pipeline or replace JSPGenerator with FileGenerator and use static
content
> >in KOI8-r to find out what is the cause of the problem.
> >
> >Regards,
> >    Konstantin Piroumian
> >
> >----- Original Message -----
> >From: "yuryx" <yu...@mobicomk.donpac.ru>
> >To: <co...@xml.apache.org>
> >Sent: Thursday, February 07, 2002 7:50 PM
> >Subject: JSPGenerator encoding problem
> >
> >
> >Hello all!
> >
> >I have following problem.
> >JSPGenerator doesn't normally encoding non english  characters.
> >Simple sample:
> >sample.jsp:
> ><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
> ><%@ page language="java"
> >import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
> >
> ><page>
> >    <content>
> >        <%out.println("<para>привет!</para>");%>
> >    </content>
> ></page>
> >
> >sample.xsl:
> ><?xml version="1.0"?>
> ><xsl:stylesheet version="1.0"
> >xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >                xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >
> >  <xsl:template match="page">
> >   <html>
> >    <head>
> >     <title>
> >      <xsl:value-of select="title"/>
> >     </title>
> >    </head>
> >    <body bgcolor="white" alink="red" link="blue" vlink="blue">
> >     <xsl:apply-templates/>
> >    </body>
> >   </html>
> >  </xsl:template>
> >
> >  <xsl:template match="para">
> >    <b><xsl:value-of select="."/></b>
> >  </xsl:template>
> ></xsl:stylesheet>
> >
> >I have following  line in sitemap:
> ><map:generator name="jsp"
> >src="org.apache.cocoon.generation.JspGenerator"
> >logger="sitemap.generator.jsp" label="content,data">
> >    <encoding>KOI8-R</encoding>
> ></map:generator>
> >...and...
> >   <map:match pattern="sample-jsp">
> >     <map:generate type="jsp" src="/statesql/sample.jsp"/>
> >     <map:transform src="statesql/sample.xsl"/>
> >     <map:serialize type="html"/>
> >    </map:match>
> >
> >After generation I have next:
> >
> ><html>
> ><head>
> ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> ><title></title>
> ></head>
> ><body vlink="blue" link="blue" alink="red" bgcolor="white">
> ><content>
> >???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
> ></content>
> ></body>
> ></html>
> >
> >
> >
> >Can anyone help me?
> >Thanx
> >Yury
> >
> >
> >
> >---------------------------------------------------------------------
> >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: <co...@xml.apache.org>
> >For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> >For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by yuryx <yu...@mobicomk.donpac.ru>.
Without transformation I have

<page>
    
<content>
    
<para>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</para>

    
</content>    

</page>

Problem with generation, I know...

Piroumian, Konstantin wrote:

>Is it the problem of JSPGenerator or maybe this happens during
>transformation or serialization? Try to remove the transformer from the
>pipeline or replace JSPGenerator with FileGenerator and use static content
>in KOI8-r to find out what is the cause of the problem.
>
>Regards,
>    Konstantin Piroumian
>
>----- Original Message -----
>From: "yuryx" <yu...@mobicomk.donpac.ru>
>To: <co...@xml.apache.org>
>Sent: Thursday, February 07, 2002 7:50 PM
>Subject: JSPGenerator encoding problem
>
>
>Hello all!
>
>I have following problem.
>JSPGenerator doesn't normally encoding non english  characters.
>Simple sample:
>sample.jsp:
><%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
><%@ page language="java"
>import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>
>
><page>
>    <content>
>        <%out.println("<para>привет!</para>");%>
>    </content>
></page>
>
>sample.xsl:
><?xml version="1.0"?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>                xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
>  <xsl:template match="page">
>   <html>
>    <head>
>     <title>
>      <xsl:value-of select="title"/>
>     </title>
>    </head>
>    <body bgcolor="white" alink="red" link="blue" vlink="blue">
>     <xsl:apply-templates/>
>    </body>
>   </html>
>  </xsl:template>
>
>  <xsl:template match="para">
>    <b><xsl:value-of select="."/></b>
>  </xsl:template>
></xsl:stylesheet>
>
>I have following  line in sitemap:
><map:generator name="jsp"
>src="org.apache.cocoon.generation.JspGenerator"
>logger="sitemap.generator.jsp" label="content,data">
>    <encoding>KOI8-R</encoding>
></map:generator>
>...and...
>   <map:match pattern="sample-jsp">
>     <map:generate type="jsp" src="/statesql/sample.jsp"/>
>     <map:transform src="statesql/sample.xsl"/>
>     <map:serialize type="html"/>
>    </map:match>
>
>After generation I have next:
>
><html>
><head>
><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
><title></title>
></head>
><body vlink="blue" link="blue" alink="red" bgcolor="white">
><content>
>???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
></content>
></body>
></html>
>
>
>
>Can anyone help me?
>Thanx
>Yury
>
>
>
>---------------------------------------------------------------------
>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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: JSPGenerator encoding problem

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Is it the problem of JSPGenerator or maybe this happens during
transformation or serialization? Try to remove the transformer from the
pipeline or replace JSPGenerator with FileGenerator and use static content
in KOI8-r to find out what is the cause of the problem.

Regards,
    Konstantin Piroumian

----- Original Message -----
From: "yuryx" <yu...@mobicomk.donpac.ru>
To: <co...@xml.apache.org>
Sent: Thursday, February 07, 2002 7:50 PM
Subject: JSPGenerator encoding problem


Hello all!

I have following problem.
JSPGenerator doesn't normally encoding non english  characters.
Simple sample:
sample.jsp:
<%out.println("<?xml version='1.0' encoding='koi8-r'?>");%>
<%@ page language="java"
import="java.text.SimpleDateFormat,java.util.*,java.sql.*"%>

<page>
    <content>
        <%out.println("<para>привет!</para>");%>
    </content>
</page>

sample.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                xmlns:xsp-request="http://apache.org/xsp/request/2.0"

  <xsl:template match="page">
   <html>
    <head>
     <title>
      <xsl:value-of select="title"/>
     </title>
    </head>
    <body bgcolor="white" alink="red" link="blue" vlink="blue">
     <xsl:apply-templates/>
    </body>
   </html>
  </xsl:template>

  <xsl:template match="para">
    <b><xsl:value-of select="."/></b>
  </xsl:template>
</xsl:stylesheet>

I have following  line in sitemap:
<map:generator name="jsp"
src="org.apache.cocoon.generation.JspGenerator"
logger="sitemap.generator.jsp" label="content,data">
    <encoding>KOI8-R</encoding>
</map:generator>
...and...
   <map:match pattern="sample-jsp">
     <map:generate type="jsp" src="/statesql/sample.jsp"/>
     <map:transform src="statesql/sample.xsl"/>
     <map:serialize type="html"/>
    </map:match>

After generation I have next:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body vlink="blue" link="blue" alink="red" bgcolor="white">
<content>
???    <b>&ETH;&Ograve;&Eacute;&times;&Aring;&Ocirc;!</b> ???
</content>
</body>
</html>



Can anyone help me?
Thanx
Yury



---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>