Hi Andreas,

I'd bet that the screwed umlaut arises already at the level of the multisearch 
generator, can you confirm this? (by looking at search.xml?cocoon-view=debug 
and checking the source code). 

If this is indeed the problem, your generator is not using the correct encoding 
to decode the request parameters. Normally, you define this encoding in 
WEB-INF/web.xml (look for "form-encoding", you should not touch  
"container-encoding" though). It should suffice to set form-encoding to the one 
you use.

However, some older generators do not honour this setting (I don't know about 
the lucene generator, but it is the case for request generator, for example). 
In this case, you have to set the encoding explicitly for the pipeline using 
SetEncodingAction. It is defined in sitemap.xmap like this (at least in 2.1.10):

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

You can then set the encoding to use for each pipeline like this:

<map:match pattern="request-params.xml">
  <map:act type="set-encoding">
   <map:parameter 
     name="form-encoding" 
     value="ISO-8859-1"/>
  </map:act>
  <map:generate type="request" />
  <!-- or whatever --> 
  <map:serialize type="xml" />
</map:match>

Hope this helps,
Johannes

-------- Original-Nachricht --------
> Datum: Wed, 12 Dec 2007 13:54:08 +0100
> Von: "Andreas Busch" <[EMAIL PROTECTED]>
> An: users@cocoon.apache.org
> Betreff: RE: Need help  Character Encoding :-((

> Hi johannes,
> 
> Here is the sitemap fragment 
> 
>   <map:match pattern="search.html*">
>         <map:aggregate label="debug" element="page">
>          <map:part src="cocoon:/OCIHook" />
>         <map:part src="cocoon:/mainmenu" element="menu"/>
>         <map:part src="cocoon:/search.xml"/>
>         </map:aggregate>
>          <map:transform src="xsl/page2xhtml.xsl" >
>                                       <map:parameter name="contextPath"
> value="{request:contextPath}/OCI" />
>         </map:transform>
>               <map:serialize type="html" />
>      </map:match>
>        
>         <map:match pattern="search">
>                       <map:redirect-to uri="cocoon:/search.html" />
>       </map:match>
> 
> The important search.xml comes from 
> 
>       <map:match pattern="search.xml">
>                               <map:generate label="debug"
> type="multisearch">
>                                       <map:parameter name="IndexFiles"
> value="{global:RealPath}/data/DE/KatalogListe.xml" />
>                                       <map:parameter name="defaultPage"
> value="8" />
>                               </map:generate>
>                               <map:transform label="debug1"
> src="xsl/Sresult.xsl">
>                                       <map:parameter name="servletPath"
>       
> value="{request:servletPath}" />
>                                       <map:parameter name="sitemapURI"
>                                               value="{request:sitemapURI}"
> />
>                                       <map:parameter name="contextPath"
>       
> value="{request:contextPath}/OCI/DE" />
>                               </map:transform>
> 
>                               <map:serialize type="xml" />
> 
>                       </map:match>
> 
> The multisearch generator is a based on lucene search generatore (only
> works
> on multiple index-files)
> 
> It's seems that the problem only happens on url-paramters.
> I have made a workeround with <form> and javascript, ist not nice ,but
> works
> 
> 
>       <form  id="pageform" action="{$contextPath}/search.html">
>               <input type="hidden" name="queryString"
> value="{../@query-string}"/>
>               <input type="hidden" name="pagelength"
> value="{../@page-length}"/>
>               <input id="startIndex" type="hidden" name="startIndex"
> value="{$offset}"/>
> 
>       .......
>                               <div id="nav-next">
>                                                                <a
> class="prevButton"
>       
> href="javascript:dopage([EMAIL PROTECTED])"/>  
> 
>                               is the next set 
> 
> Javascript-function: 
> function dopage(iStart)
>  {    
>     var myform=document.getElementById("pageform");
>     if (myform != null)
>      { 
>      var inp=document.getElementById("startIndex");
>       if (inp != null) 
>       {
>               inp.setAttribute("value",iStart);
>               myform.submit();
>          }
>       }
>    };
> 
> 
> Thanks in advance 
> 
> Andreas
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to