You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stavros Kounis <go...@osmosis.gr> on 2003/05/24 22:43:13 UTC

xsp esql gives escaped output

hi people

making queries to a msAccess database (using odbc)
using xsp esql, all greek characters come escaped
(xml serialization)

this is not a big problem but i thing that this has to do with
unsuccesfull queries when there is a "select ... where" query.

when after "where" i'm looking for english content in a field then i get
row-results i'm looking for  but when i'm looking for greek content i get
no results, and the 90% of this DB content is in greek?



is there any solution or i have to forget cocoon for this project?



thnx

--stavros



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


[SUMMARY] Re: xsp esql gives escaped output (its request param problem?)

Posted by Stavros Kounis <go...@osmosis.gr>.
after a whole weekend play with cocoon i have find a sollution

searching in this mailing archive i have notice that this is a problemm
that other users have too so i write down my experiences:


- first of all a new cocoon instance (2.1 [a cvs snapshot in my harddisk
some weeks old])

- i have leave all cocoon conf files untouched, so the default encoding is
UTF-8

- create a .html  with a form to post data, using UTF-8 encoding in head.
but here is a small point. i use XMLspy to edit all my xml, html ..files,
so there is not enough to select UTF-8 in head of html, i have to set my
editor (xmlspy) to save non-xml files using utf-8 encoding (othewise i use
to get strange results).

- create my .xsp file using utf-8 encoding. the scope of this file is just
to echo the data that my form post. (after succesfull echo i have create
more .xsp doing things with my data base)

- and final put some lines in sitemap.xmap to make clear that the posted
data are in utf-8
********sitemap.xmap entry:
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
	<map:components>
		<map:actions>
			<map:action name="set-encoding" src="org.apache.cocoon.acting.SetCharacterEncodingAction"/>
		</map:actions>
	</map:components>
	<map:pipelines>
		<map:pipeline>
			<map:act type="set-encoding">
				<map:parameter name="form-encoding" value="UTF-8"/>
			</map:act>
			<map:match pattern="*.html">
				<map:read mime-type="text/html" src="{1}.html"/>
			</map:match>
			<map:match pattern="*.xsp">
				<map:generate type="serverpages" src="{1}.xsp"/>
				<map:transform src="xml.xsl"/>
				<map:serialize type="xml"/>
			</map:match>
		</map:pipeline>
	</map:pipelines>
</map:sitemap>
**********
that's it. now i can go on with cocoon.



i think that this will be a usefull how-to for cocoon wiki but my poor
english dont let me write the how-to. so if anyone can help i can
comment and pack my example and sent to work with it.

---stavros




On Mon, 26 May 2003, Christian Haul wrote:

> On 25.May.2003 -- 03:05 PM, Stavros Kounis wrote:
> > after many combination i can't reach something that work
> >
> > i think that the problem is how xsp get request parameters
> > so i had to go one level up and test the part of my xsp that get the
> > parameters.
> >
> > using a simple .xsp that just echo the content of a req-par i cant find
> > until now the right combination that will show me in browser the (greek)
> > content of a req-par. (xml is the serialization i use for xsp)
> >
> > first
> > i have try to change all encodings for serializers in main sitemap to
> > iso-8859-7 (without success)
> >
> > second
> > i have try to change all this to utf-8 and follow the how-to in
> > wiki.cocoondev.org (without success too)
> >
> > based on:
> > http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding
> > i have put the follow instructions in web.xml:
> > 		<init-param>
> > 			<param-name>container-encoding</param-name>
> > 			<param-value>iso-8859-7</param-value>
> > 		</init-param>
> > 		<init-param>
> > 			<param-name>form-encoding</param-name>
> > 			<param-value>UTF-8</param-value>
> > 		</init-param>
>
> According to the wiki site you are referring to this should be
> iso-8859-1 for the container-encoding and utf-8 for the form
> encoding. But then you would need to set the serializers to utf-8 as
> well. Have you checked that the page with the form contains a valid
> <meta/> tag for the encoding? According to the wiki the html page
> needs to have a <head/> or the serialized will not add the encoding
> information.
>
> > now i'm consider to give up, if i can't send requsts (in greek) how can i
> > go further, and finish this project using php or asp.
>
> I would expect that you will hit the same encoding problems with other
> systems as well.
>
> > is it possible for cocoon to handle requests in other encodings (we care about greek)?
>
> Definately : yes.
>
> > is this a tomcat or java problem?
>
> >From what I understand the browser not indicating the encoding but
> using the same as the page with the form is the problem.
>
> 	Chris.
>



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


Re: xsp esql gives escaped output (its request param problem?)

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 25.May.2003 -- 03:05 PM, Stavros Kounis wrote:
> after many combination i can't reach something that work
> 
> i think that the problem is how xsp get request parameters
> so i had to go one level up and test the part of my xsp that get the
> parameters.
> 
> using a simple .xsp that just echo the content of a req-par i cant find
> until now the right combination that will show me in browser the (greek)
> content of a req-par. (xml is the serialization i use for xsp)
> 
> first
> i have try to change all encodings for serializers in main sitemap to
> iso-8859-7 (without success)
> 
> second
> i have try to change all this to utf-8 and follow the how-to in
> wiki.cocoondev.org (without success too)
> 
> based on:
> http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding
> i have put the follow instructions in web.xml:
> 		<init-param>
> 			<param-name>container-encoding</param-name>
> 			<param-value>iso-8859-7</param-value>
> 		</init-param>
> 		<init-param>
> 			<param-name>form-encoding</param-name>
> 			<param-value>UTF-8</param-value>
> 		</init-param>

According to the wiki site you are referring to this should be
iso-8859-1 for the container-encoding and utf-8 for the form
encoding. But then you would need to set the serializers to utf-8 as
well. Have you checked that the page with the form contains a valid
<meta/> tag for the encoding? According to the wiki the html page
needs to have a <head/> or the serialized will not add the encoding
information.

> now i'm consider to give up, if i can't send requsts (in greek) how can i
> go further, and finish this project using php or asp.

I would expect that you will hit the same encoding problems with other
systems as well.

> is it possible for cocoon to handle requests in other encodings (we care about greek)?

Definately : yes.

> is this a tomcat or java problem?

>From what I understand the browser not indicating the encoding but
using the same as the page with the form is the problem.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: xsp esql gives escaped output (its request param problem?)

Posted by Stavros Kounis <go...@osmosis.gr>.
after many combination i can't reach something that work

i think that the problem is how xsp get request parameters
so i had to go one level up and test the part of my xsp that get the
parameters.

using a simple .xsp that just echo the content of a req-par i cant find
until now the right combination that will show me in browser the (greek)
content of a req-par. (xml is the serialization i use for xsp)

first
i have try to change all encodings for serializers in main sitemap to
iso-8859-7 (without success)

second
i have try to change all this to utf-8 and follow the how-to in
wiki.cocoondev.org (without success too)

based on:
http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding
i have put the follow instructions in web.xml:
		<init-param>
			<param-name>container-encoding</param-name>
			<param-value>iso-8859-7</param-value>
		</init-param>
		<init-param>
			<param-name>form-encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>

now i'm consider to give up, if i can't send requsts (in greek) how can i
go further, and finish this project using php or asp.

but the big question is other, (i dont care about the specific project
because its for a friend and without importance), we have spend about
2 years following cocoon project, there is a lot of work in our harddisks,
(and we like this) but ...

is it possible for cocoon to handle requests in other encodings (we care about greek)?
is this a tomcat or java problem?
has anyone try to do something similar?

if there is a DEFINITELY negative answer and your R sure about this please
let me know to keep working with cocoon only for personal reasons and move our
production approach to other solutions.

i rely to your answers



thnx


---stavros

On Sun, 25 May 2003, Christian Haul wrote:

> Stavros Kounis wrote:
> > hi people
> >
> > making queries to a msAccess database (using odbc)
> > using xsp esql, all greek characters come escaped
> > (xml serialization)
> >
> > this is not a big problem but i thing that this has to do with
> > unsuccesfull queries when there is a "select ... where" query.
> >
> > when after "where" i'm looking for english content in a field then i get
> > row-results i'm looking for  but when i'm looking for greek content i get
> > no results, and the 90% of this DB content is in greek?
> >
> > is there any solution or i have to forget cocoon for this project?
>
> I bet this is an encoding problem. You need to make sure that the DB
> uses the correct encoding for strings (utf-8 or unicode is good), and
> the encoding of the query parameter must be correct. It's the driver's
> task to convert correctly between encodings but this requires correctly
> configured end-points.
>
> HTH
>
> 	Chris.
>
>



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


Re: xsp esql gives escaped output

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Stavros Kounis wrote:
> hi people
> 
> making queries to a msAccess database (using odbc)
> using xsp esql, all greek characters come escaped
> (xml serialization)
> 
> this is not a big problem but i thing that this has to do with
> unsuccesfull queries when there is a "select ... where" query.
> 
> when after "where" i'm looking for english content in a field then i get
> row-results i'm looking for  but when i'm looking for greek content i get
> no results, and the 90% of this DB content is in greek?
> 
> is there any solution or i have to forget cocoon for this project?

I bet this is an encoding problem. You need to make sure that the DB 
uses the correct encoding for strings (utf-8 or unicode is good), and 
the encoding of the query parameter must be correct. It's the driver's
task to convert correctly between encodings but this requires correctly
configured end-points.

HTH

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


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