Re: Problem with encoding non-english request parameters

2002-03-12 Thread Torsten Curdt




IIRC changing the encoding of the *serializer* has solved this problem for
us. Because then the POST will come with the right encoding set.


My 2 cents
--
Torsten


-
Please check that your question has not already been answered in the
FAQ before posting. 

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





Re: Problem with encoding non-english request parameters-thanx

2002-03-12 Thread yuryx

>
>
>
>I don't quite understand what do you mean.
>Yes, you can change your request character set:
>
>
>setCharacterEncoding(String)
>public void setCharacterEncoding(java.lang.String env)
>throws UnsupportedEncodingException
>
>Overrides the name of the character encoding used in the body of this
>request. This method must be called prior to reading request parameters
>or
>reading input using getReader().
>Parameters:
>a - String containing the name of the chararacter encoding.
>Throws:
>java.io.UnsupportedEncodingException - if this is not a valid
>encoding
>
>
>This should work in any Servlet 2.3 compliant server (e.g. Tomcat 4.x).
>
>Regards,
>Konstantin Piroumian
>
Sorry, I used too old  http://java.sun.com/products/servlet/2.2/javadoc/ 
 Specification...
And I don't find this features.

Thanx for the complete answer.

Yury.




-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-12 Thread Piroumian, Konstantin

> 
> >>Is serializer serialized request also? (this stupid question may be...)
> >>
> >
> >Do you need to set encoding on the coming request? This can be done with
an
> >action.
> >
> Yes, in action or use form-encoding attribute (in XSP page with use
>  logicsheet),or use manual encoding
> like : String req=new
>
String(request.getParameter("param1").getBytes("default-charset"),"needing-c
harset");
> in some servlet pages.
> :)
> But I can change request charset in client side only?
> Can I do sets request parameters like request.setCharacterEncoding()
>
> ^-in Tomcat
> But It impossible in Tomcat :( (may be :) )

I don't quite understand what do you mean.
Yes, you can change your request character set:


setCharacterEncoding(String)
public void setCharacterEncoding(java.lang.String env)
throws UnsupportedEncodingException

Overrides the name of the character encoding used in the body of this
request. This method must be called prior to reading request parameters
or
reading input using getReader().
Parameters:
a - String containing the name of the chararacter encoding.
Throws:
java.io.UnsupportedEncodingException - if this is not a valid
encoding


This should work in any Servlet 2.3 compliant server (e.g. Tomcat 4.x).

Regards,
Konstantin Piroumian

> Yury.
>
> >
> >>Yury.
> >>
> >>
> >>
> >>
> >>-
> >>Please check that your question has not already been answered in the
> >>FAQ before posting. 
> >>
> >>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> >>For additional commands, e-mail: <[EMAIL PROTECTED]>
> >>
> >
> >-
> >Please check that your question has not already been answered in the
> >FAQ before posting. 
> >
> >To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> >For additional commands, e-mail: <[EMAIL PROTECTED]>
> >
>
>
>
>
> -
> Please check that your question has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>

-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-12 Thread yuryx

Piroumian, Konstantin wrote:

>>Piroumian, Konstantin wrote:
>>
On Mon, 11 Mar 2002 18:32:26 +0300
yuryx <[EMAIL PROTECTED]> wrote:

>Vadim Gritsenko wrote:
>
>>RTFM
>>http://xml.apache.org/cocoon/userdocs/xsp/request.html:
>>8<
>>8<
>>
>>Vadim
>>
>Thanx for you help, Vadim, but I need have ,for additional, method for
>JSP also...
>And manual request-value charset encoding work as with XSP and with JSP
>:)
>
I use SetCharacterEncodingFilter distributed with tomcat. in my web.xml
it looks like:

--- cut ---

 
   Set Character Encoding
   filters.SetCharacterEncodingFilter
   
 encoding
 ISO-8859-2
   
 

 
   Set Character Encoding
   /*
 

--- cut ---

Is there a better way in cocoon+tomcat to change character encoding
globaly?

>>>You can setup your serializer this way:
>>>
>>>  >>src="org.apache.cocoon.serialization.HTMLSerializer">
>>>iso8859-2
>>>  
>>>
>>>You can have serializers with different encodings in one sitemap.
>>>
>>>Regards,
>>>   Konstantin Piroumian
>>>
--
Kazimierz Pogoda
mailto:[EMAIL PROTECTED]

>>Is serializer serialized request also? (this stupid question may be...)
>>
>
>Do you need to set encoding on the coming request? This can be done with an
>action.
>
Yes, in action or use form-encoding attribute (in XSP page with use 
 logicsheet),or use manual encoding
like : String req=new 
String(request.getParameter("param1").getBytes("default-charset"),"needing-charset"); 
in some servlet pages.
:)
But I can change request charset in client side only?
Can I do sets request parameters like request.setCharacterEncoding()

^-in Tomcat
But It impossible in Tomcat :( (may be :) )
Yury.

>
>>Yury.
>>
>>
>>
>>
>>-
>>Please check that your question has not already been answered in the
>>FAQ before posting. 
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>
>-
>Please check that your question has not already been answered in the
>FAQ before posting. 
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>
>




-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread Piroumian, Konstantin

> Piroumian, Konstantin wrote:
>
> >>On Mon, 11 Mar 2002 18:32:26 +0300
> >>yuryx <[EMAIL PROTECTED]> wrote:
> >>
> >>>Vadim Gritsenko wrote:
> >>>
> RTFM
> http://xml.apache.org/cocoon/userdocs/xsp/request.html:
> 8<
> 8<
> 
> Vadim
> 
> >>>Thanx for you help, Vadim, but I need have ,for additional, method for
> >>>JSP also...
> >>>And manual request-value charset encoding work as with XSP and with JSP
> >>>:)
> >>>
> >>I use SetCharacterEncodingFilter distributed with tomcat. in my web.xml
> >>it looks like:
> >>
> >>--- cut ---
> >>
> >>  
> >>Set Character Encoding
> >>filters.SetCharacterEncodingFilter
> >>
> >>  encoding
> >>  ISO-8859-2
> >>
> >>  
> >>
> >>  
> >>Set Character Encoding
> >>/*
> >>  
> >>
> >>--- cut ---
> >>
> >>Is there a better way in cocoon+tomcat to change character encoding
> >>globaly?
> >>
> >
> >You can setup your serializer this way:
> >
> >>src="org.apache.cocoon.serialization.HTMLSerializer">
> > iso8859-2
> >   
> >
> >You can have serializers with different encodings in one sitemap.
> >
> >Regards,
> >Konstantin Piroumian
> >
> >>--
> >>Kazimierz Pogoda
> >>mailto:[EMAIL PROTECTED]
> >>
> >
> Is serializer serialized request also? (this stupid question may be...)

Do you need to set encoding on the coming request? This can be done with an
action.

>
> Yury.
>
>
>
>
> -
> Please check that your question has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>

-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread yuryx

Piroumian, Konstantin wrote:

>>On Mon, 11 Mar 2002 18:32:26 +0300
>>yuryx <[EMAIL PROTECTED]> wrote:
>>
>>>Vadim Gritsenko wrote:
>>>
RTFM
http://xml.apache.org/cocoon/userdocs/xsp/request.html:
8<
8<

Vadim

>>>Thanx for you help, Vadim, but I need have ,for additional, method for
>>>JSP also...
>>>And manual request-value charset encoding work as with XSP and with JSP
>>>:)
>>>
>>I use SetCharacterEncodingFilter distributed with tomcat. in my web.xml
>>it looks like:
>>
>>--- cut ---
>>
>>  
>>Set Character Encoding
>>filters.SetCharacterEncodingFilter
>>
>>  encoding
>>  ISO-8859-2
>>
>>  
>>
>>  
>>Set Character Encoding
>>/*
>>  
>>
>>--- cut ---
>>
>>Is there a better way in cocoon+tomcat to change character encoding
>>globaly?
>>
>
>You can setup your serializer this way:
>
>   src="org.apache.cocoon.serialization.HTMLSerializer">
> iso8859-2
>   
>
>You can have serializers with different encodings in one sitemap.
>
>Regards,
>Konstantin Piroumian
>
>>--
>>Kazimierz Pogoda
>>mailto:[EMAIL PROTECTED]
>>
>>-
>>Please check that your question has not already been answered in the
>>FAQ before posting. 
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>
>-
>Please check that your question has not already been answered in the
>FAQ before posting. 
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>
>
Is serializer serialized request also? (this stupid question may be...)

Yury.




-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread Piroumian, Konstantin

> On Mon, 11 Mar 2002 18:32:26 +0300
> yuryx <[EMAIL PROTECTED]> wrote:
>
> > Vadim Gritsenko wrote:
> >
> > >RTFM
> > >http://xml.apache.org/cocoon/userdocs/xsp/request.html:
> > >8<
> > >8<
> > >
> > >Vadim
> > >
> > Thanx for you help, Vadim, but I need have ,for additional, method for
> > JSP also...
> > And manual request-value charset encoding work as with XSP and with JSP
> > :)
>
> I use SetCharacterEncodingFilter distributed with tomcat. in my web.xml
> it looks like:
>
> --- cut ---
>
>   
> Set Character Encoding
> filters.SetCharacterEncodingFilter
> 
>   encoding
>   ISO-8859-2
> 
>   
>
>   
> Set Character Encoding
> /*
>   
>
> --- cut ---
>
> Is there a better way in cocoon+tomcat to change character encoding
> globaly?

You can setup your serializer this way:

   
 iso8859-2
   

You can have serializers with different encodings in one sitemap.

Regards,
Konstantin Piroumian

>
> --
> Kazimierz Pogoda
> mailto:[EMAIL PROTECTED]
>
> -
> Please check that your question has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>

-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread Kazimierz Pogoda

On Mon, 11 Mar 2002 18:32:26 +0300
yuryx <[EMAIL PROTECTED]> wrote:

> Vadim Gritsenko wrote:
> 
> >RTFM 
> >http://xml.apache.org/cocoon/userdocs/xsp/request.html:
> >8<
> >xsp-request:get-parameter
> >
> >Gets the value of the named request parameter. This is a value from the
> >request string (e.g., ?fruit=apple) or from POSTed form data. If the
> >parameter has more than one value, (e.g, ?fruit=apple&fruit=orange),
> >then this gets the first value. See xsp-request:get-parameter-values.
> >Possible attributes: form-encoding (depends on the encoding of the page
> >which sends the form data) and container-encoding (default per servlet
> >spec: ISO-8859-1 but if your servlet container uses another one you can
> >adjust)  
> >8<
> >
> >Vadim
> >
> Thanx for you help, Vadim, but I need have ,for additional, method for 
> JSP also...
> And manual request-value charset encoding work as with XSP and with JSP
> :)

I use SetCharacterEncodingFilter distributed with tomcat. in my web.xml
it looks like:

--- cut ---

  
Set Character Encoding
filters.SetCharacterEncodingFilter

  encoding
  ISO-8859-2

  

  
Set Character Encoding
/*
  

--- cut ---

Is there a better way in cocoon+tomcat to change character encoding
globaly?

-- 
Kazimierz Pogoda
mailto:[EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread yuryx

Vadim Gritsenko wrote:

>RTFM 
>http://xml.apache.org/cocoon/userdocs/xsp/request.html:
>8<
>xsp-request:get-parameter
>
>Gets the value of the named request parameter. This is a value from the
>request string (e.g., ?fruit=apple) or from POSTed form data. If the
>parameter has more than one value, (e.g, ?fruit=apple&fruit=orange),
>then this gets the first value. See xsp-request:get-parameter-values.
>Possible attributes: form-encoding (depends on the encoding of the page
>which sends the form data) and container-encoding (default per servlet
>spec: ISO-8859-1 but if your servlet container uses another one you can
>adjust)  
>8<
>
>Vadim
>
Thanx for you help, Vadim, but I need have ,for additional, method for 
JSP also...
And manual request-value charset encoding work as with XSP and with JSP :)


Regards.
Yury.



-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: Problem with encoding non-english request parameters

2002-03-11 Thread Vadim Gritsenko

RTFM 
http://xml.apache.org/cocoon/userdocs/xsp/request.html:
8<
xsp-request:get-parameter

Gets the value of the named request parameter. This is a value from the
request string (e.g., ?fruit=apple) or from POSTed form data. If the
parameter has more than one value, (e.g, ?fruit=apple&fruit=orange),
then this gets the first value. See xsp-request:get-parameter-values.
Possible attributes: form-encoding (depends on the encoding of the page
which sends the form data) and container-encoding (default per servlet
spec: ISO-8859-1 but if your servlet container uses another one you can
adjust)  
8<

Vadim

> -Original Message-
> From: yuryx [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 11, 2002 5:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Problem with encoding non-english request parameters
> 
> Thanx for all!
> 
> For solved this problem just use:
> String par=new
> String(request.getParameter("text1").getBytes("ISO-8859-1"),"KOI8-R");
> 
> Regards.
> Yury.
> 
> 
> yuryx wrote:
> 
> > Hi all!
> >
> > I had the following problem:
> > In my cocoon's page I had invalid encoding my non-english characters
> > from request.
> >
> > with example:
> >
> > simple.xsp
> >
> > 
> >
> >
> >  >  xmlns:xsp="http://apache.org/xsp";
> > >
> >
> >  
> >
> >simple
> >
> >
> >
> > 
> >String par=request.getParameter("text1");
> > 
> > par
> > 
> > 
> >
> >
> >
> >  
> > 
> >
> > simple2html.xsl:
> >
> > 
> >
> >  > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> >
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
> >
> >  
> >   
> >
> > 
> >  
> > 
> >
> >
> >
> >
> >
> >   
> >  
> >
> > > priority="-2"> > select="@*|node()"/>
> >   > select="."/>
> >
> > 
> >
> > sitemap.xmap section:
> >
> >   
> >
> >
> > 
> >   
> >
> > work result:
> >
> > http://apache.org/xsp/request/2.0";>
> > 
> > 
> > simple
> > 
> > 
> >
> >http://apache.org/xsp";>simple
> >
> >http://apache.org/xsp";>
> >
> > 
> >   ×Á×
> >  
> >  
> >
> > 
> >
> >
> >
> > 
> > 
> >
> > Can anyone help me?
> >
> > Thanx.
> > Yury.
> >
> >
> >
> >
> >
> >
-
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> > For additional commands, e-mail: <[EMAIL PROTECTED]>
> >
> 
> 
> 
> 
> -
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>


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

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




Re: Problem with encoding non-english request parameters

2002-03-11 Thread yuryx

Thanx for all!

For solved this problem just use:
String par=new 
String(request.getParameter("text1").getBytes("ISO-8859-1"),"KOI8-R");

Regards.
Yury.


yuryx wrote:

> Hi all!
>
> I had the following problem:
> In my cocoon's page I had invalid encoding my non-english characters 
> from request.
>
> with example:
>
> simple.xsp
>
> 
>
>
>   xmlns:xsp="http://apache.org/xsp";
> >
>
>  
>
>simple
>
>
>
> 
>String par=request.getParameter("text1");
> 
> par
> 
> 
>
>
>
>  
> 
>
> simple2html.xsl:
>
> 
>
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
>
>  
>   
>
> 
>  
> 
>
>
>
>
>
>   
>  
>
> priority="-2"> select="@*|node()"/>
>   select="."/>
>
> 
>
> sitemap.xmap section:
>
>   
>
>
> 
>   
>
> work result:
>
> http://apache.org/xsp/request/2.0";>
> 
> 
> simple
> 
> 
>
>http://apache.org/xsp";>simple
>
>http://apache.org/xsp";>
> 
> 
>   ×Á×
>  
>  
> 
> 
>
>
>  
> 
> 
>
> Can anyone help me?
>
> Thanx.
> Yury.
>
>
>
>
>
> -
> Please check that your question has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>




-
Please check that your question has not already been answered in the
FAQ before posting. 

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




Problem with encoding non-english request parameters

2002-03-10 Thread yuryx

Hi all!

I had the following problem:
In my cocoon's page I had invalid encoding my non-english characters 
from request.

with example:

simple.xsp




http://apache.org/xsp";
 >

  

simple



 
String par=request.getParameter("text1");
 
 par
 
 



  

 
simple2html.xsl:



http://www.w3.org/1999/XSL/Transform";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>

  
   

 
  
 





   
  

   
  
  



sitemap.xmap section:

   


 
   

work result:

http://apache.org/xsp/request/2.0";>


simple




http://apache.org/xsp";>simple


http://apache.org/xsp";>


 
 
×Á×
 

 





  



Can anyone help me?

Thanx.
Yury.





-
Please check that your question has not already been answered in the
FAQ before posting. 

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