You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by eirikdentz <ei...@brainlink.com> on 2001/06/19 18:58:25 UTC

Default UTF-8 vs. iso-8859-1 encoding in HTML output

I'm a relatively new to Cocoon and XSLT, but I've verified that this
problem is specific at least to Cocoon 2.1-dev (from the beginning of
June so forgive me if this has been fixed in the most recent CVS) by
doing a comparative test using the same XML and XSL files with the Perl
XML::LibXSLT module.  The problem is this line in the XSL transformed
HTML output:

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">

Cocoon (or rather I'm guessing it might be Xalan, because I couldn't
find any place to change this in the Cocoon configuration files, but I
could have missed it.- I just grepped the various terms I was looking
for on the Cocoon directory) insists on setting the charset to UTF-8
even when I change the output line in my XSL file:

<xsl:output method="html" indent="yes" encoding="iso-8859-1" />

The Perl XML::LibXSLT module (using gnome's LibXSLT) on the other hand
changes the META tags charset attribute based my changes to the
xsl:output encoding attribute which seems to be the correct way to
handle it.

This wouldn't be that big a deal, but I'm running into a problem with
applying CSS font styles in the Macintosh version of Netscape (4.75) It
appears to be a problem with Netscape's support for UTF-8 (I can set
font sizes, weights and other styles, but it will not display san-serif
fonts when the META tag's charset attribute set to UTF-8!? The problem
goes away when it's set to iso-8859-1)

To see evidence of this for yourself just take a look some of he Cocoon2
examples that include an xsl:output encoding attribute in their xsl
files in the Mac version of Netscape (4.7*) and compare it to Internet
Explorer on the Mac or PC.

Any pointers or suggestions on where to find out more about fixing or
configuring this would be appreciated.  Also I apologize if this is a
known issue with Xalan, or if this belongs on the Xalan list rather than
the Cocoon list.

Thanks in advance

eirik



Re: Default UTF-8 vs. iso-8859-1 encoding in HTML output

Posted by eirikdentz <ei...@brainlink.com>.
Hope I'm not wasting anyone's time with this, but I found the solution to my
question/problem and wanted to post it for the benefit of anyone who might be
struggling with this or a related issue.  The answer was actually in the
sitemap documentation (my apologies for not reviewing it prior to posting my
question.  The last time I looked at the documentation on the
xml.apache.org/cocoon2/, there wasn't nearly so much there.  My deepest
gratitude to all those who've been working on the documentation.)  I did have
to make a small change to the example provided under the Serializers section
of the sitemap doc. The Serializers example on the
xml.apache.org/cocoon2/sitemap.html page uses the value attribute of the
encoding element like this: <encoding value="UTF-8"/>  I had to change it to:
<encoding>iso-8859-1</encoding>  I also had to set the <use-store> element to
false like this:

<map:transformer     name="xslt"
src="org.apache.cocoon.transformation.TraxTransformer">
    <use-store>false</use-store>

While that resolved my immediate problem, my new question is how to configure
Cocoon2 so it will use the xsl:output encoding attribute in my style sheet
rather than having to hard set it in the sitemap?  Though maybe I'm missing
the point and Cocoon2's sitemap is designed to handle this?

Thanks again for this amazing application and to all of those working on the
documentation.

eirik

eirikdentz wrote:

> I'm a relatively new to Cocoon and XSLT, but I've verified that this
> problem is specific at least to Cocoon 2.1-dev (from the beginning of
> June so forgive me if this has been fixed in the most recent CVS) by
> doing a comparative test using the same XML and XSL files with the Perl
> XML::LibXSLT module.  The problem is this line in the XSL transformed HTML
> output:
>
> <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
>
> Cocoon (or rather I'm guessing it might be Xalan, because I couldn't
> find any place to change this in the Cocoon configuration files, but I
> could have missed it.- I just grepped the various terms I was looking
> for on the Cocoon directory) insists on setting the charset to UTF-8
> even when I change the output line in my XSL file:
>
> <xsl:output method="html" indent="yes" encoding="iso-8859-1" />
>
> The Perl XML::LibXSLT module (using gnome's LibXSLT) on the other hand
> changes the META tags charset attribute based my changes to the
> xsl:output encoding attribute which seems to be the correct way to
> handle it.
>
> This wouldn't be that big a deal, but I'm running into a problem with
> applying CSS font styles in the Macintosh version of Netscape (4.75) It
> appears to be a problem with Netscape's support for UTF-8 (I can set
> font sizes, weights and other styles, but it will not display san-serif
> fonts when the META tag's charset attribute set to UTF-8!? The problem
> goes away when it's set to iso-8859-1)
>
> To see evidence of this for yourself just take a look some of he Cocoon2
> examples that include an xsl:output encoding attribute in their xsl
> files in the Mac version of Netscape (4.7*) and compare it to Internet
> Explorer on the Mac or PC.
>
> Any pointers or suggestions on where to find out more about fixing or
> configuring this would be appreciated.  Also I apologize if this is a
> known issue with Xalan, or if this belongs on the Xalan list rather than
> the Cocoon list.
>
> Thanks in advance
>
> eirik
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> 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>