You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Vladimir Figurov <vf...@asia-soft.kz> on 2004/06/25 13:37:14 UTC

Jetspeed ParameterParser realization give me a broken national char after receive from form with multipart/form-data

Hello, devs...
I'm post message in jetspeed-user - list, but not answers 8(((

*ParameterParser have a broken national char after receive from form 
with multipart/form-data 
<http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html>
http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html

*There can be you will answer?

ADDITION INFO:

after including into <form ...> additional attribute:  
accept-charset="ISO-8859-1"
national characters receive is correct! But only from Mozilla-client or 
Opera-client.
 From MS IE 6 (I dont have IE 5.5) - without changes 8(((( - I receive 
broken chars....

I find method DefaultJetspeedParameterParser.getString(String name), 
which breaks the coding:
ORIGINAL:  
public String getString(String name)
    {
        String str = super.getString(name);
        if (str == null) return null;

        try
        {
            return new String(str.getBytes("8859_1"), 
getCharacterEncoding());
        }
        catch (Exception e)
        {
            logger.warn("DefaultJetspeedParameterParser: Exception: " + 
e.toString());
            return str;
        }

    }

MY MODIFICATION:
        try
        {
            //from Opera - exception, but on in&out - characters correct
            //from Mozilla - in - correct, out - correct
            //from IE 6 - in INCORRECT, out - correct
            return new String(str.getBytes(), getCharacterEncoding());
        }

-- 
Vladimir


Re: Jetspeed ParameterParser realization give me a broken national char after receive from form with multipart/form-data

Posted by Shinsuke SUGAYA <sh...@yahoo.co.jp>.
Hi,

According to Java API doc,  getBytes() is "Encodes this String into a sequence of bytes
using the platform's default charset, storing the result into a new byte array.".
So, the platform's default charset is used... Therefore, some regression may occur in
non-English environment. I have submitted this patch in JS1-387. Please see my patch.

Regards,
 shinsuke


Scott T Weaver wrote:
> Hi Valdimir,
> 
> Send your fix in a patch format and someone will apply it.
> 
> 
> On Fri, 2004-06-25 at 07:37, Vladimir Figurov wrote:
> 
>>Hello, devs...
>>I'm post message in jetspeed-user - list, but not answers 8(((
>>
>>*ParameterParser have a broken national char after receive from form 
>>with multipart/form-data 
>><http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html>
>>http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html
>>
>>*There can be you will answer?
>>
>>ADDITION INFO:
>>
>>after including into <form ...> additional attribute:  
>>accept-charset="ISO-8859-1"
>>national characters receive is correct! But only from Mozilla-client or 
>>Opera-client.
>> From MS IE 6 (I dont have IE 5.5) - without changes 8(((( - I receive 
>>broken chars....
>>
>>I find method DefaultJetspeedParameterParser.getString(String name), 
>>which breaks the coding:
>>ORIGINAL:  
>>public String getString(String name)
>>    {
>>        String str = super.getString(name);
>>        if (str == null) return null;
>>
>>        try
>>        {
>>            return new String(str.getBytes("8859_1"), 
>>getCharacterEncoding());
>>        }
>>        catch (Exception e)
>>        {
>>            logger.warn("DefaultJetspeedParameterParser: Exception: " + 
>>e.toString());
>>            return str;
>>        }
>>
>>    }
>>
>>MY MODIFICATION:
>>        try
>>        {
>>            //from Opera - exception, but on in&out - characters correct
>>            //from Mozilla - in - correct, out - correct
>>            //from IE 6 - in INCORRECT, out - correct
>>            return new String(str.getBytes(), getCharacterEncoding());
>>        }

__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Jetspeed ParameterParser realization give me a broken national char after receive from form with multipart/form-data

Posted by Scott T Weaver <sc...@binary-designs.net>.
Hi Valdimir,

Send your fix in a patch format and someone will apply it.


On Fri, 2004-06-25 at 07:37, Vladimir Figurov wrote:
> Hello, devs...
> I'm post message in jetspeed-user - list, but not answers 8(((
> 
> *ParameterParser have a broken national char after receive from form 
> with multipart/form-data 
> <http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html>
> http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/msg12954.html
> 
> *There can be you will answer?
> 
> ADDITION INFO:
> 
> after including into <form ...> additional attribute:  
> accept-charset="ISO-8859-1"
> national characters receive is correct! But only from Mozilla-client or 
> Opera-client.
>  From MS IE 6 (I dont have IE 5.5) - without changes 8(((( - I receive 
> broken chars....
> 
> I find method DefaultJetspeedParameterParser.getString(String name), 
> which breaks the coding:
> ORIGINAL:  
> public String getString(String name)
>     {
>         String str = super.getString(name);
>         if (str == null) return null;
> 
>         try
>         {
>             return new String(str.getBytes("8859_1"), 
> getCharacterEncoding());
>         }
>         catch (Exception e)
>         {
>             logger.warn("DefaultJetspeedParameterParser: Exception: " + 
> e.toString());
>             return str;
>         }
> 
>     }
> 
> MY MODIFICATION:
>         try
>         {
>             //from Opera - exception, but on in&out - characters correct
>             //from Mozilla - in - correct, out - correct
>             //from IE 6 - in INCORRECT, out - correct
>             return new String(str.getBytes(), getCharacterEncoding());
>         }
-- 
******************************************
*           Scott T. Weaver              *
*         <we...@apache.org>            *
*     <http://www.einnovation.com>       *   
* -------------------------------------- *
*   Apache Jetspeed Enterprise Portal    *
*     Apache Pluto Portlet Container     *
*                                        *
* OpenEditPro, Website Content Mangement *
*     <http://www.openeditpro.com>       *
******************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Jetspeed ParameterParser realization give me a broken national char after receive from form with multipart/form-data

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Jun 25, 2004, at 4:37 AM, Vladimir Figurov wrote:

> Hello, devs...
> I'm post message in jetspeed-user - list, but not answers 8(((
>
> *ParameterParser have a broken national char after receive from form  
> with multipart/form-data  
> <http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/ 
> msg12954.html>
> http://www.mail-archive.com/jetspeed-user%40jakarta.apache.org/ 
> msg12954.html
>
> *There can be you will answer?
>
Im applying Sinsuke's patch now (JS1-387)
Will that fix your problem?

> ADDITION INFO:
>
> after including into <form ...> additional attribute:   
> accept-charset="ISO-8859-1"
> national characters receive is correct! But only from Mozilla-client  
> or Opera-client.
> From MS IE 6 (I dont have IE 5.5) - without changes 8(((( - I receive  
> broken chars....
>
> I find method DefaultJetspeedParameterParser.getString(String name),  
> which breaks the coding:
> ORIGINAL:  public String getString(String name)
>    {
>        String str = super.getString(name);
>        if (str == null) return null;
>
>        try
>        {
>            return new String(str.getBytes("8859_1"),  
> getCharacterEncoding());
>        }
>        catch (Exception e)
>        {
>            logger.warn("DefaultJetspeedParameterParser: Exception: " +  
> e.toString());
>            return str;
>        }
>
>    }
>
> MY MODIFICATION:
>        try
>        {
>            //from Opera - exception, but on in&out - characters correct
>            //from Mozilla - in - correct, out - correct
>            //from IE 6 - in INCORRECT, out - correct
>            return new String(str.getBytes(), getCharacterEncoding());
>        }
>
> -- 
> Vladimir
>
>

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office]   +01 707 773-4646
[mobile] +01 707 529 9194



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org