xml-xsp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Vindevogel <yves.vindevo...@implements.be>
Subject Problem with Character Encoding in Cocoon 2 / Postgres
Date Wed, 11 Dec 2002 09:35:46 GMT
This was also posted on cocoon-users.  But I don't know if this is Cocoon 
related or XSP related.

----------    ----------

Subject: Problem with Character Encoding in Cocoon 2 / Postgres
Date: Wed, 11 Dec 2002 10:32:26 +0100
From: Yves Vindevogel <yves.vindevogel@implements.be>
To: cocoon-users@xml.apache.org


I'm using Cocoon 2 and Postgres 7 on Slackware 8, JDK 1.4.
My database and pages contain French characters (like é,à,ç, ...)
I use XSP to get the data from PG.

I can show all the data correctly when I set the encoding to ISO-8859-1.
I wrote some plsql procedures to store data.  I call them from my XSP pages.
This is where it goes wrong: the French characters are stored in an
 unreadable manner.  (Storing is the only thing where it goes wrong)

Calling the function from the command line with the French characters works
fine.  It's only when I post the page and call the function that it goes

Any ideas ??

Here's some of my code:

1) Sample XSP where it goes wrong
<?xml version="1.0" encoding="ISO-8859-1"?>

    <xsp:page language="java"

        		<link rel="stylesheet" type="text/css"

                	<div style="position:absolute; left: 5px; top: 5px">
                        	<img src="./../images/product.png"/>

                        <div style="position:absolute; left: 60px; top: 5px">
                        	<h1>Nouveau type de cancer</h1>

                        <div style="position:relative; top: 40px">


				select fnCancerTypeInsert ('<xsp-request:get-parameter

						if (<esql:get-string column="fnCancerTypeInsert"/>.equals("1"))
							<p class="error">Ce type de cancer existe déja.  Les modifications ne
sont pas enrégistrées.</p>
						} ;
                                                if (<esql:get-string
							<p class="message">Les modifications sont enrégistrées.</p>

                                        <input type="submit" value="Rétour"
onclick="window.location = './cancertypes.list.html';" class="button"/>


2) Cocoon.xconf setting for the database
    <jdbc name="pierrefabre">
      <pool-controller max="10" min="5"/>


3) The pgplsql function called in that page
create function fnCancerTypeInsert (varchar(50)) returns integer as
        	p_description alias for $1 ;

  		v_count integer ;
        	select into v_count count(*) from tblCancerTypes
                	where upper(description) = upper(p_description) ;

         	if v_count > 0 then
                	return 1 ;
          	end if ;

                insert into tblCancerTypes
                	values (p_description) ;

           	return 0 ;
        end ;
' language 'plpgsql' ;

Kind regards,
Yves Vindevogel

Kortrijkstraat 2 bus 1  --  9700 Oudenaarde  --  Belgium
Phone/Fax: +32 (55) 45.74.73  --  Mobile: +32 (478) 80.82.91
Mail: yves.vindevogel@implements.be  --  www.implements.be

Quote: The winner never says participating is more important than winning.

View raw message