You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Foror <fo...@mail.ru> on 2008/01/14 08:34:59 UTC

T5: decode URL with non english symbols

In this method

    public static String urlDecode(String input) // input = "новый" (russian word)
    {
        try
        {
            return CODEC.decode(input); // return "?????" after call this method
        }
        catch (DecoderException ex)
        {
            throw new RuntimeException(ex);
        }
    }

In Tomcat "<Connector URIEncoding="UTF-8"/>"


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


Re: T5: decode URL with non english symbols

Posted by Dapeng <da...@spiralcomms.com>.
Foror wrote:
> D> is ur page.tml using the same encoding ??
> D> juz my 2c
> D> if so .. u may need to test ur CODEC.decode
>
> All in UTF-8
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>   
then better use debugger, stops at the point

CODEC.decode(input);



check value of input is indeed what u expecting

then step into ur decode method




IMO it is likely an minor bug in ur decode method

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


Re: Antwort: Re[4]: T5: decode URL with non english symbols

Posted by Foror <fo...@mail.ru>.
KM> now i see what you want... it is not possible
KM> you can only use ASCII characters in URLs, 
KM> any other character has to be encoded.

Firefox URL: tag/%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9+%D0%BA%D1%83 (word = "новый")

After click this link, and begin tapestry debug in CODEC.codec(input)
input = "новый" in UTF-8





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


Antwort: Re[4]: T5: decode URL with non english symbols

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
now i see what you want... it is not possible
you can only use ASCII characters in URLs, 
any other character has to be encoded.

please read:
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
http://www.ietf.org/rfc/rfc1738.txt




Foror <fo...@mail.ru> 
14.01.2008 11:29
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
"Tapestry users" <us...@tapestry.apache.org>
Kopie

Thema
Re[4]: T5: decode URL with non english symbols







F> Testing in Opera9, IE6 and FireFox2 on Tomcat 5.5
Tomcat 5.5 with URIEncoding="UTF-8"


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



Re[4]: T5: decode URL with non english symbols

Posted by Foror <fo...@mail.ru>.
F> Testing in Opera9, IE6 and FireFox2 on Tomcat 5.5
Tomcat 5.5 with URIEncoding="UTF-8"


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


Re[3]: T5: decode URL with non english symbols

Posted by Foror <fo...@mail.ru>.
KM> have you tried this:
KM> http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding

It does not work. In URLCodec (commons-codec-1.3) method

    public String decode(String pString, String charset)
        throws DecoderException, UnsupportedEncodingException 
    {
        if (pString == null) {
            return null;
        }
        return new String(decode(pString.getBytes(StringEncodings.US_ASCII)), charset);
    }

pString normal russian text in UTF-8, after pString.getBytes(StringEncodings.US_ASCII) it is bad text.
Testing in Opera9, IE6 and FireFox2 on Tomcat 5.5


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


Re[2]: T5: decode URL with non english symbols

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
have you tried this: http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding

g,
kris




Foror <fo...@mail.ru> 
14.01.2008 11:06
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
"Tapestry users" <us...@tapestry.apache.org>
Kopie

Thema
Re[2]: T5: decode URL with non english symbols







D> is ur page.tml using the same encoding ??
D> juz my 2c
D> if so .. u may need to test ur CODEC.decode

All in UTF-8


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



Re[2]: T5: decode URL with non english symbols

Posted by Foror <fo...@mail.ru>.
D> is ur page.tml using the same encoding ??
D> juz my 2c
D> if so .. u may need to test ur CODEC.decode

All in UTF-8


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


Re: T5: decode URL with non english symbols

Posted by Dapeng <da...@spiralcomms.com>.
Foror wrote:
> In this method
>
>     public static String urlDecode(String input) // input = "новый" (russian word)
>     {
>         try
>         {
>             return CODEC.decode(input); // return "?????" after call this method
>         }
>         catch (DecoderException ex)
>         {
>             throw new RuntimeException(ex);
>         }
>     }
>
> In Tomcat "<Connector URIEncoding="UTF-8"/>"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>   


is ur page.tml using the same encoding ??

juz my 2c

if so .. u may need to test ur CODEC.decode




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