cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CARLETTA ANGELO <ANGELO.CARLE...@PV.BE>
Subject Re: form encoding UTF-8 / ISO-8859-1
Date Thu, 01 Jan 1970 00:00:00 GMT
--- Reçu de       INFETUDE.G145193 02/250.96.71              17-01-03 10.59

--- Reçu de       INFETUDE.G145193 02/250.96.71              17-01-03 08.26

Hi.

I have add de next line in web.xml of my application but whitout effect
    <init-param>
      <param-name>container-encoding</param-name>
      <param-value>ISO-8859-1</param-value>
    </init-param>
    <init-param>
      <param-name>form-encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>

The web.xml
<!DOCTYPE web-app

    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">



<web-app id="WebApp_ID">
  <display-name>Vagen avec Cocoon2</display-name>
  <description>Web module  for Vagen Web Transactions</description>

    <!-- Debut Ajouté par Carletta.  (VaGen) -->
  <servlet id="Servlet_2">
     <servlet-name>vgnt</servlet-name>
     <display-name>vgnt</display-name>
     <description>Gateway for NT web transactions</description>
     <servlet-class>com.ibm.hpt.gateway.GatewayServlet</servlet-class>
     <init-param id="InitParam_2">
        <param-name>hptGatewayProperties</param-name>
        <param-
value>c:/tomcat/webapps/VagenWebModule/gwnt.properties</param-value>
     </init-param>
  </servlet>
    <!-- fin Ajouté par Carletta.  -->

  <servlet>

    <servlet-name>Cocoon2</servlet-name>

    <display-name>Cocoon2</display-name>

    <description>The main Cocoon2 servlet</description>

    <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>

    <!-- Debut Ajouté par Carletta.  -->
    <init-param>
      <param-name>container-encoding</param-name>
      <param-value>ISO-8859-1</param-value>
    </init-param>
    <init-param>
      <param-name>form-encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <!-- fin Ajouté par Carletta.  -->
...........

</web-app>


Without Cocoon, the send form (from JSP) is Western European(ISO) and with
Cocoon, the send form is UTF-8

Angelo

****************************************************************************


From: murad@asbt.uz
To: cocoon-users@xml.apache.org
Date: Fri, 17 Jan 2003 12:21:46 +0500
Subject: Re: form encoding UTF-8 / ISO-8859-1

Artur Bialecki wrote:
> I looked at the javadoc for java.lang package (jdk1.3.1)
> and java.nio.charset.Charset (jdk1.4.1) and it
> looks like the UTF-8 is the correct name.

> I have a feeling setting the container encoding to ISO-8859-1
> is what fixed your problem.

> Another word of caution is the java.net.URLEncoder class that
> doesn't play nice with UTF-8 in pre 1.4 jdk version.

> Artur...



>>-----Original Message-----
>>From: Murad Jura [mailto:murad@asbt.uz]
>>Sent: January 16, 2003 6:55 AM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: form encoding UTF-8 / ISO-8859-1
>>
>>
>>Martin Koeppe wrote:
>>
>>>Hello,
>>>
>>>I'm using a recent developer version of cocoon 2.1 (Jan 9 2003),
>>>tomcat 4.1.12 on SuSE Linux 8.0 Kernel 2.4.20,
>>>and I found a problem with parsing the request parameters from a GET
>>>request:
>>>
>>>The browser (both Mozilla and IE) sends them as UTF-8, but cocoon
>>>interprets them as ISO-8859-1. The problem can be seen e.g.
>>
>>with form
>>
>>>validator: if you enter a non-ASCII7 character, and there
>>
>>is something not
>>
>>>correct for the form validator within ANOTHER field, you
>>
>>get the first
>>
>>>field back changed.
>>>
>>>I have enabled "container-encoding" and "form-encoding" in
>>
>>web.xml, and
>>
>>>set both to "utf-8", but with no success (no change in behaviour).
>>>
>>>1) Can someone help?
>>>
>>>
>>>I looked at the source, too:
>>>org.apache.cocoon.environment.http.HttpRequest
>>>
>>>There are getCharacterEncoding() and setCharacterEncoding().
>>>Whereas get...() is mapped to the servlet engine function,
>>>set...() seems to be implemented within cocoon.
>>>
>>>In my experiments a call to set...("UTF-8") directly before
>>
>>reading the
>>
>>>parameters within a flow script didn't work, either. (no change)
>>>get...() always returned null.
>>>
>>>2) Can someone explain the idea of the set...() function,
>>
>>in combination
>>
>>>with decode(), i.e. why that should work? Or: what should
>>
>>be done to get
>>
>>>it work?
>>>
>>>3) Why doesn't get...() return the value that was set before with
>>>set...(), i.e. why is the servlet value returned, whereas the cocoon
>>>internal value seems to be used?
>>>
>>>
>>>Thanks in advance
>>>
>>>Martin Koeppe
>>>
>>>
>>
>>---------------------------------------------------------------------
>>
>>>Please check that your question  has not already been
>>
>>answered in the
>>
>>>FAQ before posting.
>>
>><http://xml.apache.org/cocoon/faq/in> dex.html>
>>
>>>To
>>
>>unsubscribe, e-mail:
>><cocoon-users-unsubscribe@xml.apache.org>
>>
>>>For additional commands, e-mail:
>>
>><cocoon-users-help@xml.apache.org>
>>
>>Hello Martin,
>>
>>I want to inform you that I solved such problem by setting
>>the web.xml's
>>"container-encoding" parameter to ISO-8859-1 and the "form-encoding"
>>parameter to "UTF8" (not "UTF-8" because "UTF8" is the
>>internal Java's
>>name of this encoding type, see Java Documentation).
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question  has not already been answered in the
>>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>>
>>To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
>>For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>>


> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Thank you Artur!

I have tested both UTF-8 and UTF8 and in all cases I have obtained
successfull results. But I have to set "form-encoding" parameter to
"UTF-8/UTF8" to get my russian data in the correct form.

Murad Jura.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>

---- 17-01-03 10.59 ---- Envoyé à      -------------------------------------
  -> COCOON-USERS@XML.APACHE.ORG


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


postmaster@pv.be
*******************************************************************


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message