You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Yves Vindevogel <yv...@implements.be> on 2003/10/08 00:13:26 UTC
French characters within xsp:logic
Hi
I have this piece of code in XSP
<xsp:logic>
String sWelcome = "";
String sAbout = "" ;
if (<xsp-session:get-attribute name="lang"/>.equals("Nl"))
{
sWelcome = "Welkom" ;
sAbout = "Privé" ;
} ;
if (<xsp-session:get-attribute name="lang"/>.equals("Fr"))
{
sWelcome = "Bienvenue" ;
sAbout = "Privé" ;
} ;
if (<xsp-session:get-attribute name="lang"/>.equals("En"))
{
sWelcome = "Welcome" ;
sAbout = "Private" ;
} ;
<div id="dTop">
<span><xsp:expr>sWelcome</xsp:expr></span>
--- more here --
<span><xsp:expr>sAbout</xsp:expr></span>
</div>
</xsp:logic>
This works fine for me, except, when showing the characters in my output, I
get funny chars (looks like eastern European things)
When I add this like <p>Privé</p> , I have no problems, but within the
xsp:logic, I get the strang behaviour.
Anyone know a solution ??
Yves Vindevogel
Implements
Kempische Steenweg 206 - 3500 Hasselt - Belgium
Tel+Fax: +32-11-43.55.76 Mobile: +32-478-80.82.91
yves.vindevogel@implements.be - www.implements.be
First they ignore you. Then they laugh at you. Then they fight you. Then you
win.
Mahatma Ghandi.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: French characters within xsp:logic
Posted by Simon Bretin <si...@anyware-tech.com>.
Hello,
You might want to try the special String(byte[],String) constructor that
takes an encoding as second parameter. The default java encoding might
not be the one you need, thus making the toString() methods behave
strangely ...
Just a thought ...
Simon.
Yves Vindevogel wrote:
>An easy sample page to show the error ....
>
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsp:page language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:xsp-session="http://apache.org/xsp/session/2.0"
> create-session="true">
>
>
> <html>
> <body>
> <xsp:logic>
> String sFrench = "";
> sFrench = "Here are some French characters: ����" ;
>
> <p><xsp:expr>sFrench</xsp:expr></p>
>
> <p>Here are the same characters, but not through xsp:expr: ����</p>
> </xsp:logic>
> </body>
> </html>
>
>
></xsp:page>
>
>
>
>
>
><html xmlns:xsp-session="http://apache.org/xsp/session/2.0"
>xmlns:xsp="http://apache.org/xsp"
>xmlns:xsp-request="http://apache.org/xsp/request/2.0">
>
><body>
>
><p>Here are some French characters: ����</p>
><p>Here are the same characters, but not through xsp:expr:
>éàèç</p>
>
></body>
>
></html>
>
>-----Original Message-----
>From: Yves Vindevogel [mailto:yves.vindevogel@implements.be]
>Sent: woensdag 8 oktober 2003 10:09
>To: users@cocoon.apache.org
>Subject: RE: French characters within xsp:logic
>
>
>ISO-8859-1
>
> <map:serializer logger="sitemap.serializer.html"
>mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4"
>src="org.apache.cocoon.serialization.HTMLSerializer">
> <buffer-size>1024</buffer-size>
> <encoding>ISO-8859-1</encoding>
> </map:serializer>
>
>
>It works fine with all characters when they are not coming from an xsp:logic
>I think the compilation of the XSP looses the french characters.
>That possible ?
>
>
>-----Original Message-----
>From: gounis@osmosis.gr [mailto:gounis@osmosis.gr]
>Sent: woensdag 8 oktober 2003 1:52
>To: users@cocoon.apache.org; yves.vindevogel@implements.be
>Subject: Re: French characters within xsp:logic
>
>
>
>
>what is the encoding you use in your (final) html page?
>
>i guess that the content is coming to you in UTF and you try to display it
>using a different encoding
>
>i use to have similar problem when post data from an xsp-->html
>
>first of all try to set everything in UTF
>
>-- stavros
>
>
>
>On Wed, 8 Oct 2003, Yves Vindevogel wrote:
>
>
>
>>Hi
>>
>>I have this piece of code in XSP
>>
>> <xsp:logic>
>> String sWelcome = "";
>> String sAbout = "" ;
>>
>> if (<xsp-session:get-attribute name="lang"/>.equals("Nl"))
>> {
>> sWelcome = "Welkom" ;
>> sAbout = "Priv�" ;
>> } ;
>>
>> if (<xsp-session:get-attribute name="lang"/>.equals("Fr"))
>> {
>> sWelcome = "Bienvenue" ;
>> sAbout = "Priv�" ;
>> } ;
>>
>> if (<xsp-session:get-attribute name="lang"/>.equals("En"))
>> {
>> sWelcome = "Welcome" ;
>> sAbout = "Private" ;
>> } ;
>>
>> <div id="dTop">
>> <span><xsp:expr>sWelcome</xsp:expr></span>
>>
>> --- more here --
>>
>> <span><xsp:expr>sAbout</xsp:expr></span>
>> </div>
>> </xsp:logic>
>>
>>
>>This works fine for me, except, when showing the characters in my output,
>>
>>
>I
>
>
>>get funny chars (looks like eastern European things)
>>
>>When I add this like <p>Priv�</p> , I have no problems, but within the
>>xsp:logic, I get the strang behaviour.
>>
>>Anyone know a solution ??
>>
>>
>>
>>Yves Vindevogel
>>Implements
>>
>>Kempische Steenweg 206 - 3500 Hasselt - Belgium
>>Tel+Fax: +32-11-43.55.76 Mobile: +32-478-80.82.91
>>yves.vindevogel@implements.be - www.implements.be
>>
>>
>>First they ignore you. Then they laugh at you. Then they fight you. Then
>>
>>
>you
>
>
>>win.
>>Mahatma Ghandi.
>>
>>
>>---------------------------------------------------------------------
>>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
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
RE: French characters within xsp:logic
Posted by Yves Vindevogel <yv...@implements.be>.
An easy sample page to show the error ....
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
create-session="true">
<html>
<body>
<xsp:logic>
String sFrench = "";
sFrench = "Here are some French characters: ����" ;
<p><xsp:expr>sFrench</xsp:expr></p>
<p>Here are the same characters, but not through xsp:expr: ����</p>
</xsp:logic>
</body>
</html>
</xsp:page>
<html xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<body>
<p>Here are some French characters: ����</p>
<p>Here are the same characters, but not through xsp:expr:
éàèç</p>
</body>
</html>
-----Original Message-----
From: Yves Vindevogel [mailto:yves.vindevogel@implements.be]
Sent: woensdag 8 oktober 2003 10:09
To: users@cocoon.apache.org
Subject: RE: French characters within xsp:logic
ISO-8859-1
<map:serializer logger="sitemap.serializer.html"
mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4"
src="org.apache.cocoon.serialization.HTMLSerializer">
<buffer-size>1024</buffer-size>
<encoding>ISO-8859-1</encoding>
</map:serializer>
It works fine with all characters when they are not coming from an xsp:logic
I think the compilation of the XSP looses the french characters.
That possible ?
-----Original Message-----
From: gounis@osmosis.gr [mailto:gounis@osmosis.gr]
Sent: woensdag 8 oktober 2003 1:52
To: users@cocoon.apache.org; yves.vindevogel@implements.be
Subject: Re: French characters within xsp:logic
what is the encoding you use in your (final) html page?
i guess that the content is coming to you in UTF and you try to display it
using a different encoding
i use to have similar problem when post data from an xsp-->html
first of all try to set everything in UTF
-- stavros
On Wed, 8 Oct 2003, Yves Vindevogel wrote:
> Hi
>
> I have this piece of code in XSP
>
> <xsp:logic>
> String sWelcome = "";
> String sAbout = "" ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Nl"))
> {
> sWelcome = "Welkom" ;
> sAbout = "Priv�" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Fr"))
> {
> sWelcome = "Bienvenue" ;
> sAbout = "Priv�" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("En"))
> {
> sWelcome = "Welcome" ;
> sAbout = "Private" ;
> } ;
>
> <div id="dTop">
> <span><xsp:expr>sWelcome</xsp:expr></span>
>
> --- more here --
>
> <span><xsp:expr>sAbout</xsp:expr></span>
> </div>
> </xsp:logic>
>
>
> This works fine for me, except, when showing the characters in my output,
I
> get funny chars (looks like eastern European things)
>
> When I add this like <p>Priv�</p> , I have no problems, but within the
> xsp:logic, I get the strang behaviour.
>
> Anyone know a solution ??
>
>
>
> Yves Vindevogel
> Implements
>
> Kempische Steenweg 206 - 3500 Hasselt - Belgium
> Tel+Fax: +32-11-43.55.76 Mobile: +32-478-80.82.91
> yves.vindevogel@implements.be - www.implements.be
>
>
> First they ignore you. Then they laugh at you. Then they fight you. Then
you
> win.
> Mahatma Ghandi.
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: French characters within xsp:logic
Posted by Yves Vindevogel <yv...@implements.be>.
ISO-8859-1
<map:serializer logger="sitemap.serializer.html"
mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4"
src="org.apache.cocoon.serialization.HTMLSerializer">
<buffer-size>1024</buffer-size>
<encoding>ISO-8859-1</encoding>
</map:serializer>
It works fine with all characters when they are not coming from an xsp:logic
I think the compilation of the XSP looses the french characters.
That possible ?
-----Original Message-----
From: gounis@osmosis.gr [mailto:gounis@osmosis.gr]
Sent: woensdag 8 oktober 2003 1:52
To: users@cocoon.apache.org; yves.vindevogel@implements.be
Subject: Re: French characters within xsp:logic
what is the encoding you use in your (final) html page?
i guess that the content is coming to you in UTF and you try to display it
using a different encoding
i use to have similar problem when post data from an xsp-->html
first of all try to set everything in UTF
-- stavros
On Wed, 8 Oct 2003, Yves Vindevogel wrote:
> Hi
>
> I have this piece of code in XSP
>
> <xsp:logic>
> String sWelcome = "";
> String sAbout = "" ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Nl"))
> {
> sWelcome = "Welkom" ;
> sAbout = "Privé" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Fr"))
> {
> sWelcome = "Bienvenue" ;
> sAbout = "Privé" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("En"))
> {
> sWelcome = "Welcome" ;
> sAbout = "Private" ;
> } ;
>
> <div id="dTop">
> <span><xsp:expr>sWelcome</xsp:expr></span>
>
> --- more here --
>
> <span><xsp:expr>sAbout</xsp:expr></span>
> </div>
> </xsp:logic>
>
>
> This works fine for me, except, when showing the characters in my output,
I
> get funny chars (looks like eastern European things)
>
> When I add this like <p>Privé</p> , I have no problems, but within the
> xsp:logic, I get the strang behaviour.
>
> Anyone know a solution ??
>
>
>
> Yves Vindevogel
> Implements
>
> Kempische Steenweg 206 - 3500 Hasselt - Belgium
> Tel+Fax: +32-11-43.55.76 Mobile: +32-478-80.82.91
> yves.vindevogel@implements.be - www.implements.be
>
>
> First they ignore you. Then they laugh at you. Then they fight you. Then
you
> win.
> Mahatma Ghandi.
>
>
> ---------------------------------------------------------------------
> 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: French characters within xsp:logic
Posted by go...@osmosis.gr.
what is the encoding you use in your (final) html page?
i guess that the content is coming to you in UTF and you try to display it
using a different encoding
i use to have similar problem when post data from an xsp-->html
first of all try to set everything in UTF
-- stavros
On Wed, 8 Oct 2003, Yves Vindevogel wrote:
> Hi
>
> I have this piece of code in XSP
>
> <xsp:logic>
> String sWelcome = "";
> String sAbout = "" ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Nl"))
> {
> sWelcome = "Welkom" ;
> sAbout = "Privι" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("Fr"))
> {
> sWelcome = "Bienvenue" ;
> sAbout = "Privι" ;
> } ;
>
> if (<xsp-session:get-attribute name="lang"/>.equals("En"))
> {
> sWelcome = "Welcome" ;
> sAbout = "Private" ;
> } ;
>
> <div id="dTop">
> <span><xsp:expr>sWelcome</xsp:expr></span>
>
> --- more here --
>
> <span><xsp:expr>sAbout</xsp:expr></span>
> </div>
> </xsp:logic>
>
>
> This works fine for me, except, when showing the characters in my output, I
> get funny chars (looks like eastern European things)
>
> When I add this like <p>Privι</p> , I have no problems, but within the
> xsp:logic, I get the strang behaviour.
>
> Anyone know a solution ??
>
>
>
> Yves Vindevogel
> Implements
>
> Kempische Steenweg 206 - 3500 Hasselt - Belgium
> Tel+Fax: +32-11-43.55.76 Mobile: +32-478-80.82.91
> yves.vindevogel@implements.be - www.implements.be
>
>
> First they ignore you. Then they laugh at you. Then they fight you. Then you
> win.
> Mahatma Ghandi.
>
>
> ---------------------------------------------------------------------
> 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