You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Z.Z." <za...@vili.pmmf.hu> on 2004/07/21 22:35:31 UTC

Serialization encoding problem

Hi All,

I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls is 
utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
When I see source of my generated htmls, character set is utf-8. But 
in body all of accented char is made  by acuted (&aacute; ...). 
Accented chars In head section is correct, only in body are wrong.
in head:

=============================================
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.Táblázat1.A1{
background-color:#d9d9d9; }
...
</head>
=============================================
in  body:

=============================================
<body>

<table class="T&aacute;bl&aacute;zat1">
...
. A 8 vari&aacute;c&oacute; k&ouml;z&uuml;l egyes 
&aacute;ll&iacute;t&aacute;sok pontosak, m&aacute;sok hamisak, de 
mindegyik meghat&aacute;rozott (2.1. t&aacute;bl&aacute;zat).
=============================================

in sitemap.xmap there is :

<map:serializers default="html">		
  <map:serializer name="html" mime-type="text/html; charset=utf-8" 
			 src="org.apache.cocoon.serialization.HTMLSerializer">
    <encoding>utf-8</encoding>
    <omit-xml-declaration>true</omit-xml-declaration>
  </map:serializer>
</map:serializers>

in web.xml there is:
    <init-param>
      <param-name>container-encoding</param-name>
      <param-value>utf-8</param-value>
    </init-param>

    <init-param>
      <param-name>form-encoding</param-name>
      <param-value>utf-8</param-value>
    </init-param>

How can I prevent acuted chars in body?

-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694

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


Re: Serialization encoding problem

Posted by "Z.Z." <za...@vili.pmmf.hu>.
Hi All,
2004. július 22. 01.10 dátummal Ray Allis ezt írta:
> Z.Z. wrote:
> >Hi All,
> >
> >I use Cocoon 2.1.5.1 in Linux environment. Character set of my
> > xmls is utf-8. All of setting is utf-8 (web.xml, sitemap.xmap,
> > xsls...) When I see source of my generated htmls, character set
> > is utf-8. But in body all of accented char is made  by acuted
> > (&aacute; ...). Accented chars In head section is correct, only
> > in body are wrong. in head:
>

> I have a related problem.  I have <xsl:output ... encoding="UTF-8"
> ... in a stylesheet.
> When I run xalan from the command line the output is UTF-8.
> When I use the sitemap, serialize as xml, it is always ISO-8859-1
> in the xml document returned to the browser.
>
> Ray Allis
Thanks Ray, but it doesn't help me. It was in my xsl-s :-(

-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694

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


Re: Serialization encoding problem

Posted by Upayavira <uv...@upaya.co.uk>.
Zidarics Zoltan wrote:

>2004. július 22. 08.21 dátummal Upayavira ezt írta:
>  
>
>>Have you set the encoding in the definition of your serializer (at the
>>top of the sitemap)?
>>    
>>
>yes:
>			<map:serializer name="html" mime-type="text/html; charset=UTF-8"
>						src="org.apache.cocoon.serialization.HTMLSerializer">
>				<encoding>UTF-8</encoding>
>				<omit-xml-declaration>true</omit-xml-declaration>
>			</map:serializer> 
>
>  
>
>>If that doesn't work, in the CVS version of Cocoon (possibly in 2.1.5)
>>there is a serializers block, which contains alternative HTMLSerializer
>>and XMLSerializer, which I have found to work better in this regard.
>>
>>Regards, Upayavira
>>    
>>
>Oooops, what are you thinking? Should you say what is name of this?
>I am using 2.1.5.1.
>  
>
Enable the serializers block and recompile cocoon. I've just checked, it 
is included in 2.1.5.1. Then in your serialiser definition put 
org.apache.cocoon.components.serialization.HTMLSerializer instead of the 
existing src.

Try that.

Upayavira




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


Re: Serialization encoding problem

Posted by Zidarics Zoltan <za...@vili.pmmf.hu>.
2004. július 22. 08.21 dátummal Upayavira ezt írta:
> Have you set the encoding in the definition of your serializer (at the
> top of the sitemap)?
yes:
			<map:serializer name="html" mime-type="text/html; charset=UTF-8"
						src="org.apache.cocoon.serialization.HTMLSerializer">
				<encoding>UTF-8</encoding>
				<omit-xml-declaration>true</omit-xml-declaration>
			</map:serializer> 

>
> If that doesn't work, in the CVS version of Cocoon (possibly in 2.1.5)
> there is a serializers block, which contains alternative HTMLSerializer
> and XMLSerializer, which I have found to work better in this regard.
>
> Regards, Upayavira
Oooops, what are you thinking? Should you say what is name of this?
I am using 2.1.5.1.

-- 
thx,
Zamek
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: zamek@vili.pmmf.hu
----------------------------------

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


Re: Serialization encoding problem

Posted by Zidarics Zoltan <za...@vili.pmmf.hu>.
Hi All,

2004. július 22. 08.21 dátummal Upayavira ezt írta:
> Ray Allis wrote:
> > Z.Z. wrote:
> >> Hi All,
> >>
> >> I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls
> >> is utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
> >> When I see source of my generated htmls, character set is utf-8. But
> >> in body all of accented char is made  by acuted (&aacute; ...).
> >> Accented chars In head section is correct, only in body are wrong.
> >> in head:
> >
> > I have a related problem.  I have <xsl:output ... encoding="UTF-8" ...
> > in a stylesheet.
> > When I run xalan from the command line the output is UTF-8.
> > When I use the sitemap, serialize as xml, it is always ISO-8859-1 in the
> > xml document returned to the browser.
>
> Have you set the encoding in the definition of your serializer (at the
> top of the sitemap)?
Yes:
			<map:serializer name="html" mime-type="text/html; charset=UTF-8"
						src="org.apache.cocoon.serialization.HTMLSerializer">
				<encoding>UTF-8</encoding>
				<omit-xml-declaration>true</omit-xml-declaration>
			</map:serializer> 

> If that doesn't work, in the CVS version of Cocoon (possibly in 2.1.5)
> there is a serializers block, which contains alternative HTMLSerializer
> and XMLSerializer, which I have found to work better in this regard.
Oooops, what are you thinking? Should you say the name of this? I use 2.1.5.1.

>
> Regards, Upayavira
-- 
thx,
Zamek
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: zamek@vili.pmmf.hu
----------------------------------

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


Re: Serialization encoding problem

Posted by Upayavira <uv...@upaya.co.uk>.
Ray Allis wrote:

> Z.Z. wrote:
>
>> Hi All,
>>
>> I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls 
>> is utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
>> When I see source of my generated htmls, character set is utf-8. But 
>> in body all of accented char is made  by acuted (&aacute; ...). 
>> Accented chars In head section is correct, only in body are wrong.
>> in head:
>>  
>>
>
> I have a related problem.  I have <xsl:output ... encoding="UTF-8" ... 
> in a stylesheet.
> When I run xalan from the command line the output is UTF-8.
> When I use the sitemap, serialize as xml, it is always ISO-8859-1 in the
> xml document returned to the browser.
>
Have you set the encoding in the definition of your serializer (at the 
top of the sitemap)?

If that doesn't work, in the CVS version of Cocoon (possibly in 2.1.5) 
there is a serializers block, which contains alternative HTMLSerializer 
and XMLSerializer, which I have found to work better in this regard.

Regards, Upayavira



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


Re: Serialization encoding problem

Posted by Ray Allis <ra...@comcast.net>.
Z.Z. wrote:

>Hi All,
>
>I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls is 
>utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
>When I see source of my generated htmls, character set is utf-8. But 
>in body all of accented char is made  by acuted (&aacute; ...). 
>Accented chars In head section is correct, only in body are wrong.
>in head:
>  
>

I have a related problem.  I have <xsl:output ... encoding="UTF-8" ... 
in a stylesheet.
When I run xalan from the command line the output is UTF-8.
When I use the sitemap, serialize as xml, it is always ISO-8859-1 in the
xml document returned to the browser.

Ray Allis

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


Re: Serialization encoding problem

Posted by "Volkm@r" <pl...@arcor.de>.
Z.Z. wrote:
> Hi All,
> 
> I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls is 
> utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
> When I see source of my generated htmls, character set is utf-8. But 
> in body all of accented char is made  by acuted (&aacute; ...). 
> Accented chars In head section is correct, only in body are wrong.
> in head:
> [...]

Any special reason for not using xml serializer for html?

=============================================================
<map:serializers default="xml">
   .....
   <map:serializer name="xhtml" mime-type="application/xhtml+xml"
                   logger="sitemap.serializer.xhtml"
                   pool-grow="2" pool-max="64" pool-min="2"
                   src="org.apache.cocoon.serialization.XMLSerializer">
     <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
     <doctype-system>
       http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
     </doctype-system>
     <encoding>UTF-8</encoding>
     <indent>yes</indent>
   </map:serializer>
   <map:serializer name="html" mime-type="text/html; charset=utf-8"
                   logger="sitemap.serializer.html"
                   pool-grow="2" pool-max="64" pool-min="2"
                   src="org.apache.cocoon.serialization.XMLSerializer">
     <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
     <doctype-system>
       http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
     </doctype-system>
     <omit-xml-declaration>yes</omit-xml-declaration>
     <omit-namespaces>yes</omit-namespaces>
     <encoding>UTF-8</encoding>
     <indent>yes</indent>
   </map:serializer>
</map:serializers>
=============================================================

The second one is designed to omit XML declaration in order to force 
M$IE into standards compliant mode. And it has *twice* utf-8, one in 
mime-type for the HTTP header and one in <encoding>UTF-8</encoding> for 
serializing the output.

-- 
Volkmar W. Pogatzki


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


Re: Serialization encoding problem

Posted by go...@osmosis.gr.
try to use disable-output-escaping="yes"


<xsl:value-of select="." disable-output-escaping="yes"/>


-- stavros

On Wed, 21 Jul 2004, Z.Z. wrote:

> Hi All,
> 
> I use Cocoon 2.1.5.1 in Linux environment. Character set of my xmls is 
> utf-8. All of setting is utf-8 (web.xml, sitemap.xmap, xsls...)
> When I see source of my generated htmls, character set is utf-8. But 
> in body all of accented char is made  by acuted (&aacute; ...). 
> Accented chars In head section is correct, only in body are wrong.
> in head:
> 
> =============================================
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> <style type="text/css">
> .Tαblαzat1.A1{
> background-color:#d9d9d9; }
> ...
> </head>
> =============================================
> in  body:
> 
> =============================================
> <body>
> 
> <table class="T&aacute;bl&aacute;zat1">
> ...
> . A 8 vari&aacute;c&oacute; k&ouml;z&uuml;l egyes 
> &aacute;ll&iacute;t&aacute;sok pontosak, m&aacute;sok hamisak, de 
> mindegyik meghat&aacute;rozott (2.1. t&aacute;bl&aacute;zat).
> =============================================
> 
> in sitemap.xmap there is :
> 
> <map:serializers default="html">		
>   <map:serializer name="html" mime-type="text/html; charset=utf-8" 
> 			 src="org.apache.cocoon.serialization.HTMLSerializer">
>     <encoding>utf-8</encoding>
>     <omit-xml-declaration>true</omit-xml-declaration>
>   </map:serializer>
> </map:serializers>
> 
> in web.xml there is:
>     <init-param>
>       <param-name>container-encoding</param-name>
>       <param-value>utf-8</param-value>
>     </init-param>
> 
>     <init-param>
>       <param-name>form-encoding</param-name>
>       <param-value>utf-8</param-value>
>     </init-param>
> 
> How can I prevent acuted chars in body?
> 
> 


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