You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Zellhoefer <da...@8bit-inferno.de> on 2003/12/14 23:45:15 UTC
German special character got lost during XSP processing
Hej,
I have a problem with the encoding of special characters (my assumption)
and their processing in Cocoon. You'll find my configuration below.
I have a database holding some strings with special German "Umlaute"
such as ä, ö etc.
All characters are stored right, when I check them with the MySQL
console or with PHPMyAdmin on the server.
If I run a query with ESQL and retrieve some strings from MySQL Cocoon
produces a weird output like "thisIsATest?", where the last character
should be one of the "Umlauts".
I programmed a work-around for DOS which only takes the string and
replaces all characters with themselves (String.replaceAll()).
This approach doesn't work under Linux.
I have a pipeline finally ending in a HTML output, but the XML produced
by the XSP has this problem as well.
Has anyone an idea how to encode the characters in a way that Cocoon is
able to work with? Or do I have to change something else?
Cheers,
David
************************
System:
RedHat 8.0
Java 1.4.1
Cocoon 2.0.4
MySQL Ver 8.23 Distrib 3.23.52
mysql-connector-java-2.0.14-bin.jar
--
David Zellhöfer
Västanågatan 22.207
582 35 Linköping
Sverige
phone: +46 (0)13 149 188
mobile phone: +46 (0)70 856 93 46
e-mail: david@8bit-inferno.de
icq: 241095373
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: German special character got lost during XSP processing
Posted by Collin VanDyck <co...@hannonhill.com>.
We had a similar problem... We ended up using UTF-8 for everything; it
manifests itself in a couple of places. Here's what we did - your mileage
may vary:
1. In your web.xml for your webapp, you'll want to set these params:
<init-param>
<param-name>container-encoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
<init-param>
<param-name>form-encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
You can find more information about that here:
http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding
Then, in the sitemap, define your serializer with a specific encoding
(UTF-8):
<map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer">
<encoding>UTF-8</encoding>
</map:serializer>
At that point, redeploy, and generate an XSP. In your browser, look to see
what the character encoding is. It should be UTF-8. If it is not, and you
are still seeing the funny characters, change it to UTF-8 in your browser.
It should fix it. At that point, you know that it is a problem configuring
your client browser. There is more information at the link above on how to
force certain browsers to use your encoding using response headers.
If changing to UTF-8 manually does NOT help, then I'm not sure what the
problem is.
Hope that helps,
Collin
----- Original Message -----
From: "David Zellhoefer" <da...@8bit-inferno.de>
To: <xs...@xml.apache.org>
Sent: Sunday, December 14, 2003 5:45 PM
Subject: German special character got lost during XSP processing
> Hej,
>
> I have a problem with the encoding of special characters (my assumption)
> and their processing in Cocoon. You'll find my configuration below.
>
> I have a database holding some strings with special German "Umlaute"
> such as ä, ö etc.
> All characters are stored right, when I check them with the MySQL
> console or with PHPMyAdmin on the server.
>
> If I run a query with ESQL and retrieve some strings from MySQL Cocoon
> produces a weird output like "thisIsATest?", where the last character
> should be one of the "Umlauts".
> I programmed a work-around for DOS which only takes the string and
> replaces all characters with themselves (String.replaceAll()).
> This approach doesn't work under Linux.
> I have a pipeline finally ending in a HTML output, but the XML produced
> by the XSP has this problem as well.
>
> Has anyone an idea how to encode the characters in a way that Cocoon is
> able to work with? Or do I have to change something else?
>
> Cheers,
>
> David
>
> ************************
> System:
>
> RedHat 8.0
> Java 1.4.1
> Cocoon 2.0.4
> MySQL Ver 8.23 Distrib 3.23.52
> mysql-connector-java-2.0.14-bin.jar
>
> --
> David Zellhöfer
> Västanågatan 22.207
>
> 582 35 Linköping
> Sverige
>
> phone: +46 (0)13 149 188
> mobile phone: +46 (0)70 856 93 46
> e-mail: david@8bit-inferno.de
> icq: 241095373
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: German special character got lost during XSP processing
Posted by Joose Vettenranta <jo...@iki.fi>.
Hey,
I think I had similar problems with PostgreSQL. The problem might be
that that esql charset's are different than those in SQL-database (like
utf-8 <-> iso-8859-1). I made it so, that data in PostgreSQL is stored
as unicode but that didn't solve that problem yet. Last thing I did to
solve the problem was in cocoon.xconf:
<dburl>jdbc:postgresql://localhost/database?charSet=UTF-8</dburl>
After that everything started to work ok.
- Joose
15.12.2003 kello 00:45, David Zellhoefer kirjoitti:
Hej,
>
> I have a problem with the encoding of special characters (my
> assumption) and their processing in Cocoon. You'll find my
> configuration below.
>
> I have a database holding some strings with special German "Umlaute"
> such as ä, ö etc.
> All characters are stored right, when I check them with the MySQL
> console or with PHPMyAdmin on the server.
>
> If I run a query with ESQL and retrieve some strings from MySQL Cocoon
> produces a weird output like "thisIsATest?", where the last character
> should be one of the "Umlauts".
> I programmed a work-around for DOS which only takes the string and
> replaces all characters with themselves (String.replaceAll()).
> This approach doesn't work under Linux.
> I have a pipeline finally ending in a HTML output, but the XML
> produced by the XSP has this problem as well.
>
> Has anyone an idea how to encode the characters in a way that Cocoon
> is able to work with? Or do I have to change something else?
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org