You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2003/11/27 11:57:49 UTC

encoding, UTF-8

Hi,

I want to put the entire plateform into UTF-8. For now, cocoon is using 
ISO-8859-1.

Here what I've already done :

<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>UTF-8</encoding>
</map:serializer>


But that's not enough because I have many problem with the form.
When I reload it with some request parameter (using xsl:value-of).

The characters are not display good.

For example the é become é .
Any idea ?

I use Cocoon 2.0.4

Lionel




Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: encoding, UTF-8

Posted by Lionel Crine <cr...@4dconcept.fr>.
In fact :


The "encoding" parameter for the serializer modify the <?xml ...?> 
declaration according the the value.
Now I'm sure of that, my previous message was false.

Now, I'm using that :

  <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>UTF-8</encoding>
  </map:serializer>

This lines above allow me not to set the form-encoding parameter as UTF-8 
in the web.xml.

Finally, the form is working well. But the url parameters are not encoded 
well if I make a go back from the result page to the form page.
I think xsl can't encode the parameter. Maybe an xsp could do that.

For instant, instead of using a <a href>, I use a <form> with <input 
type="hidden">.

Lionel

At 13:02 27/11/2003 +0100, you wrote:
>Did you set the form-encoding parameter in web.xml?
>
>Guido
>
>Lionel Crine wrote:
> > Hi,
> >
> > I want to put the entire plateform into UTF-8. For now, cocoon is
> > using ISO-8859-1.
> >
> > Here what I've already done :
> >
> > <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>UTF-8</encoding>
> > </map:serializer>
> >
> >
> > But that's not enough because I have many problem with the form.
> > When I reload it with some request parameter (using xsl:value-of).
> >
> > The characters are not display good.
> >
> > For example the é become Ãf© .
> > Any idea ?
> >
> > I use Cocoon 2.0.4
> >
> > Lionel
> >
> >
> >
> >
> > Lionel CRINE
> > Ingénieur Systèmes documentaires
> > Société : 4DConcept
> > 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> > Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> >
> >
> > ---------------------------------------------------------------------
> > 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

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: encoding, UTF-8

Posted by Guido Casper <gc...@s-und-n.de>.
Did you set the form-encoding parameter in web.xml?

Guido

Lionel Crine wrote:
> Hi,
>
> I want to put the entire plateform into UTF-8. For now, cocoon is
> using ISO-8859-1.
>
> Here what I've already done :
>
> <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>UTF-8</encoding>
> </map:serializer>
>
>
> But that's not enough because I have many problem with the form.
> When I reload it with some request parameter (using xsl:value-of).
>
> The characters are not display good.
>
> For example the é become Ãf© .
> Any idea ?
>
> I use Cocoon 2.0.4
>
> Lionel
>
>
>
>
> Lionel CRINE
> Ingénieur Systèmes documentaires
> Société : 4DConcept
> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
>
>
> ---------------------------------------------------------------------
> 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: encoding, UTF-8

Posted by Lionel Crine <cr...@4dconcept.fr>.
Thx.

At 16:03 27/11/2003 +0200, you wrote:
>we have solve the same problem using action
>
>                 <map:actions>
>                         <map:action name="set-encoding" 
> src="org.apache.cocoon.acting.SetCharacterEncodingAction"/>
>
>...
>...
>...
>
>                 <!-- === order form === -->
>                 <map:pipeline>
>                         <map:act type="set-encoding">
>                                 <map:parameter name="form-encoding" 
> value="iso-8859-7"/>
>                         </map:act>
>                         <map:act type="locale">
>                                 <map:match pattern="order/proceed">
>                                         <map:aggregate element="order">
>                                                 <map:part 
> src="cocoon:/order/product"/>
>                                                 <map:part 
> src="cocoon:/order/def"/>
>                                         </map:aggregate>
>                                         <map:transform 
> src="../htdocs/serverpages/order.xsl"/>
>                                         <map:serialize type="html"/>
>                                 </map:match>
>                                 <map:match pattern="order/product">
>                                         <map:generate 
> src="../htdocs/serverpages/product.xsp" type="serverpages"/>
>                                         <map:serialize type="xml"/>
>                                 </map:match>
>                                 <map:match pattern="order/def">
>                                         <map:generate 
> src="../htdocs/serverpages/def.xml"/>
>                                         <map:serialize type="xml"/>
>                                 </map:match>
>                         </map:act>
>                 </map:pipeline>
>
>-- stavros
>
>On Thu, 27 Nov 2003, Boris Althaus wrote:
>
> > Hallo Lionel,
> >
> > we had problems with this issues several times.
> > Play arround with these two initparams.
> > The strange thing was, that on different engines we had to change the 
> container-encoding to avoid encoding problems.
> > Now we do not have any problems with encoding anymore and we don't need 
> entries in the sitemaps.
> >
> >                 <init-param>
> >                         <param-name>form-encoding</param-name>
> >                         <param-value>UTF-8</param-value>
> >                 </init-param>
> >                 <init-param>
> >                         <param-name>container-encoding</param-name>
> >                         <param-value>ISO-8859-1</param-value>
> >                 </init-param>
> > Boris
> >   ----- Original Message -----
> >   From: Lionel Crine
> >   To: users@cocoon.apache.org
> >   Sent: Thursday, November 27, 2003 11:57 AM
> >   Subject: encoding, UTF-8
> >
> >
> >   Hi,
> >
> >   I want to put the entire plateform into UTF-8. For now, cocoon is using
> >   ISO-8859-1.
> >
> >   Here what I've already done :
> >
> >   <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>UTF-8</encoding>
> >   </map:serializer>
> >
> >
> >   But that's not enough because I have many problem with the form.
> >   When I reload it with some request parameter (using xsl:value-of).
> >
> >   The characters are not display good.
> >
> >   For example the é become Ãf© .
> >   Any idea ?
> >
> >   I use Cocoon 2.0.4
> >
> >   Lionel
> >
> >
> >
> >
> >   Lionel CRINE
> >   Ingénieur Systèmes documentaires
> >   Société : 4DConcept
> >   22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> >   Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> >
> >
> >   ---------------------------------------------------------------------
> >   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

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


RE: RequestParameterModule

Posted by Roman Hrivik <hr...@isdd.sk>.
I think that some of web containers implement the
request.getPatameter("myparam");
to return an empty string if parameter is not in request.

I tested it on Oracle OC4J and it returns null.
I think that this is not good.
Imagine you have a pipeline and you want to pass
A request parameter to transformation.
But this parameter is optional and not required.

When I do request-param:myparam
and there is no such parameter in querystring - than I've got an
NullPointerException

I did my own request-param input module which solve this
and it will return an empty string.

Roman



-----Původní zpráva-----
Od: Christian Haul [mailto:haul@informatik.tu-darmstadt.de] 
Odesláno: 27. novembra 2003 20:20
Komu: users@cocoon.apache.org
Předmět: Re: RequestParameterModule

Roman Hrivik wrote:
> This can be reported as bug, I think.
> 
> When I try to access for parameter from request in sitemap and in
> request is not such parameter I'll get null-exception.
> 
> I think that RequestParameterModule should return always not null
value.

Nope since "" is different from null eg on database updates. If there is
a null pointer exception inside the sitemap engine, this is an error
since it should expect null values from an input module and replace it
with "". Could you provide a test case for this that shows the error?
(A short test of mine didn't reveal any problems.)

	Chris.


---------------------------------------------------------------------
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: RequestParameterModule

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Roman Hrivik wrote:
> This can be reported as bug, I think.
> 
> When I try to access for parameter from request in sitemap and in
> request is not such parameter I'll get null-exception.
> 
> I think that RequestParameterModule should return always not null value.

Nope since "" is different from null eg on database updates. If there is
a null pointer exception inside the sitemap engine, this is an error
since it should expect null values from an input module and replace it
with "". Could you provide a test case for this that shows the error?
(A short test of mine didn't reveal any problems.)

	Chris.


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


RequestParameterModule

Posted by Roman Hrivik <hr...@isdd.sk>.
This can be reported as bug, I think.

When I try to access for parameter from request in sitemap and in
request is not such parameter I'll get null-exception.

I think that RequestParameterModule should return always not null value.


The method getAttribute from RequestParameterModule shoul be like this.




   public Object getAttribute( 
		String name,
		Configuration modeConf, 
		Map objectModel )
		 throws ConfigurationException {

        String pname = (String) this.settings.get("parameter", name);

        if ( modeConf != null ) {
            pname = modeConf.getChild("parameter").getValue(pname);
        }

        String value =
ObjectModelHelper.getRequest(objectModel).getParameter( pname );

        if (value == null) {
			return "";
		} 
	  else {
            	return value;
		} 

    }








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


Re: encoding, UTF-8

Posted by go...@osmosis.gr.
we have solve the same problem using action

		<map:actions>
			<map:action name="set-encoding" src="org.apache.cocoon.acting.SetCharacterEncodingAction"/>

...
...
...

		<!-- === order form === -->
		<map:pipeline>
			<map:act type="set-encoding">
				<map:parameter name="form-encoding" value="iso-8859-7"/>
			</map:act>
			<map:act type="locale">
				<map:match pattern="order/proceed">
					<map:aggregate element="order">
						<map:part src="cocoon:/order/product"/>
						<map:part src="cocoon:/order/def"/>
					</map:aggregate>
					<map:transform src="../htdocs/serverpages/order.xsl"/>
					<map:serialize type="html"/>
				</map:match>
				<map:match pattern="order/product">
					<map:generate src="../htdocs/serverpages/product.xsp" type="serverpages"/>
					<map:serialize type="xml"/>
				</map:match>
				<map:match pattern="order/def">
					<map:generate src="../htdocs/serverpages/def.xml"/>
					<map:serialize type="xml"/>
				</map:match>
			</map:act>
		</map:pipeline>

-- stavros

On Thu, 27 Nov 2003, Boris Althaus wrote:

> Hallo Lionel,
> 
> we had problems with this issues several times.
> Play arround with these two initparams.
> The strange thing was, that on different engines we had to change the container-encoding to avoid encoding problems. 
> Now we do not have any problems with encoding anymore and we don't need entries in the sitemaps.
> 
>                 <init-param>
>                         <param-name>form-encoding</param-name>
>                         <param-value>UTF-8</param-value>
>                 </init-param>
>                 <init-param>
>                         <param-name>container-encoding</param-name>
>                         <param-value>ISO-8859-1</param-value>
>                 </init-param>
> Boris
>   ----- Original Message ----- 
>   From: Lionel Crine 
>   To: users@cocoon.apache.org 
>   Sent: Thursday, November 27, 2003 11:57 AM
>   Subject: encoding, UTF-8
> 
> 
>   Hi,
> 
>   I want to put the entire plateform into UTF-8. For now, cocoon is using 
>   ISO-8859-1.
> 
>   Here what I've already done :
> 
>   <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>UTF-8</encoding>
>   </map:serializer>
> 
> 
>   But that's not enough because I have many problem with the form.
>   When I reload it with some request parameter (using xsl:value-of).
> 
>   The characters are not display good.
> 
>   For example the ι become ΓfΒ© .
>   Any idea ?
> 
>   I use Cocoon 2.0.4
> 
>   Lionel
> 
> 
> 
> 
>   Lionel CRINE
>   Ingιnieur Systθmes documentaires
>   Sociιtι : 4DConcept
>   22 rue Etienne de Jouy 78353 JOUY EN JOSAS
>   Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> 
> 
>   ---------------------------------------------------------------------
>   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: encoding, UTF-8

Posted by Boris Althaus <bo...@petra-productions.de>.
Hallo Lionel,

we had problems with this issues several times.
Play arround with these two initparams.
The strange thing was, that on different engines we had to change the container-encoding to avoid encoding problems. 
Now we do not have any problems with encoding anymore and we don't need entries in the sitemaps.

                <init-param>
                        <param-name>form-encoding</param-name>
                        <param-value>UTF-8</param-value>
                </init-param>
                <init-param>
                        <param-name>container-encoding</param-name>
                        <param-value>ISO-8859-1</param-value>
                </init-param>
Boris
  ----- Original Message ----- 
  From: Lionel Crine 
  To: users@cocoon.apache.org 
  Sent: Thursday, November 27, 2003 11:57 AM
  Subject: encoding, UTF-8


  Hi,

  I want to put the entire plateform into UTF-8. For now, cocoon is using 
  ISO-8859-1.

  Here what I've already done :

  <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>UTF-8</encoding>
  </map:serializer>


  But that's not enough because I have many problem with the form.
  When I reload it with some request parameter (using xsl:value-of).

  The characters are not display good.

  For example the é become Ãf© .
  Any idea ?

  I use Cocoon 2.0.4

  Lionel




  Lionel CRINE
  Ingénieur Systèmes documentaires
  Société : 4DConcept
  22 rue Etienne de Jouy 78353 JOUY EN JOSAS
  Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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

RE: encoding, UTF-8

Posted by go...@osmosis.gr.
i'm allmost sure that the entire cocoon has UTF-8 as default encoding

corect me 


--stavros 



On Thu, 27 Nov 2003, Nicolas Toper wrote:

> Are you sure, the viewer is UTF8?
> 
> -----Message d'origine-----
> De : Lionel Crine [mailto:crine@4dconcept.fr]
> Envoyι : jeudi 27 novembre 2003 11:58
> ΐ : users@cocoon.apache.org
> Objet : encoding, UTF-8
> 
> 
> Hi,
> 
> I want to put the entire plateform into UTF-8. For now, cocoon is using
> ISO-8859-1.
> 
> Here what I've already done :
> 
> <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>UTF-8</encoding>
> </map:serializer>
> 
> 
> But that's not enough because I have many problem with the form.
> When I reload it with some request parameter (using xsl:value-of).
> 
> The characters are not display good.
> 
> For example the ι become é .
> Any idea ?
> 
> I use Cocoon 2.0.4
> 
> Lionel
> 
> 
> 
> 
> Lionel CRINE
> Ingιnieur Systθmes documentaires
> Sociιtι : 4DConcept
> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> 
> 
> ---------------------------------------------------------------------
> 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: encoding, UTF-8

Posted by Tim Cavanagh <ti...@tafe.sa.edu.au>.

> From: "Nicolas Toper" <nt...@jouve.fr>
> Reply-To: users@cocoon.apache.org
> Date: Thu, 27 Nov 2003 12:16:11 +0100
> To: <us...@cocoon.apache.org>
> Subject: RE: encoding, UTF-8
> 
> Are you sure, the viewer is UTF8?
> 
> -----Message d'origine-----
> De : Lionel Crine [mailto:crine@4dconcept.fr]
> Envoyé : jeudi 27 novembre 2003 11:58
> À : users@cocoon.apache.org
> Objet : encoding, UTF-8
> 
> 
> Hi,
> 
> I want to put the entire plateform into UTF-8. For now, cocoon is using
> ISO-8859-1.
> 
> Here what I've already done :
> 
> <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>UTF-8</encoding>
> </map:serializer>
> 
> 
> But that's not enough because I have many problem with the form.
> When I reload it with some request parameter (using xsl:value-of).
> 
> The characters are not display good.
> 
> For example the é become é .
> Any idea ?
> 
> I use Cocoon 2.0.4
> 
> Lionel
> 

In tomcat you may have to start up with utf-8 flags as well

>From the catalina.sh shell script

CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF-8"

Not sure if this will help but I think that it will unless you are using
jetty then I can't offer any help.

Cheers

Tim Cavanagh


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


RE: encoding, UTF-8

Posted by Nicolas Toper <nt...@jouve.fr>.
Are you sure, the viewer is UTF8?

-----Message d'origine-----
De : Lionel Crine [mailto:crine@4dconcept.fr]
Envoyé : jeudi 27 novembre 2003 11:58
À : users@cocoon.apache.org
Objet : encoding, UTF-8


Hi,

I want to put the entire plateform into UTF-8. For now, cocoon is using
ISO-8859-1.

Here what I've already done :

<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>UTF-8</encoding>
</map:serializer>


But that's not enough because I have many problem with the form.
When I reload it with some request parameter (using xsl:value-of).

The characters are not display good.

For example the é become é .
Any idea ?

I use Cocoon 2.0.4

Lionel




Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


---------------------------------------------------------------------
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