Hi Jay,
(Jay) Jun Yan wrote:
> Thorsten,
>
> The source code does seem being coded in such a way to handle the
> situation
> you described. But on my env, the UTF-8 encoded parameters, like if name=
> %E9%A1%B9%E7%9B%AE
> is not decoded with ISO-8895-1 (how could it decode that with
> ISO-8895-1?)
> by Tomcat, or at least not decoded in the way as you described.
>
The Servlet Spec 2.3 specifies ISO-8859-1 as default character encoding
(SRV.4.9) if none is set by the client request. So, I assume your
browser is setting the character encoding to UTF-8. Which browser are
you using? Could you check the http request header of your browser for
any encoding settings? Another possibility would be to check the value
of a getRequest().getCharacterEncoding() before
new String(paramValues[i].getBytes(" ISO-8859-1"), encoding).
> BTW, my env, Tomcat 5.5 and Jetspeed 2.0, has the patch you provided
> http://issues.apache.org/jira/browse/JS2-555. Is that this patch that
> makes
> the get-bytes-as-ISO-8895-1-then-reconstruct-as-UTF-8 work-around not
> working?
>
The patch does only affect the login process.
Regards, Thorsten
> Anyway, if name=%E9%A1%B9%E7%9B%AE, with new
> String(paramValues[i].getBytes(" ISO-8859-1"), encoding), I got ??,
> and with
> new String(paramValues[i].getBytes("UTF-8"), encoding), I got 项目.
>
> Cheers,
>
> Jay
>
> On 7/24/06, Thorsten Berger <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi Jay,
>>
>> the quoted source lines are correct, as the request parameters have
>> already been decoded by Tomcat using ISO-8859-1. So, you get the raw
>> values by paramValues[i].getBytes("ISO-8859-1") and do decode them
>> (again) using the configured encoding (browser dependent, mostly UTF-8)
>> in the String constructor.
>> I remember those lines, as I had another decoding problem with
>> ServletRequestImpl some time ago ;)
>>
>> Regards, Thorsten
>>
>>
>> (Jay) Jun Yan wrote:
>>
>> > If the encoding is customizable, it proves more that to have
>> ISO-8895-1
>> > hardcoded is a bug of Jetspeed.
>> >
>> > Thanks,
>> >
>> > Jay
>> >
>> > On 7/23/06, Shinsuke SUGAYA <[EMAIL PROTECTED]> wrote:
>> >
>> >>
>> >> The encoding is customizable. You can find it in:
>> >> etc/sql/populate-db-default.sql
>> >>
>> >> INSERT INTO MEDIA_TYPE (MEDIATYPE_ID,NAME, CHARACTER_SET, TITLE,
>> >> DESCRIPTION)
>> >> VALUES(1,'html','UTF-8','HTML','Rich HTML for HTML 4.0 compliants
>> >> browsers');
>> >>
>> >> INSERT INTO MEDIA_TYPE (MEDIATYPE_ID,NAME, CHARACTER_SET, TITLE,
>> >> DESCRIPTION)
>> >> VALUES(2,'wml','UTF-8','WML','Format for mobile phones and PDAs
>> >> compatible
>> >> with WML 1.1');
>> >>
>> >> INSERT INTO MEDIA_TYPE (MEDIATYPE_ID,NAME, CHARACTER_SET, TITLE,
>> >> DESCRIPTION)
>> >> VALUES(3,'vxml','UTF-8','VoiceXML','Format suitable for use with an
>> >> audio
>> >> VoiceXML server');
>> >>
>> >> INSERT INTO MEDIA_TYPE (MEDIATYPE_ID,NAME, CHARACTER_SET, TITLE,
>> >> DESCRIPTION)
>> >> VALUES(4,'xml','','XML','XML 1.0');
>> >>
>> >> INSERT INTO MEDIA_TYPE (MEDIATYPE_ID,NAME, CHARACTER_SET, TITLE,
>> >> DESCRIPTION)
>> >> VALUES(5,'xhtml-basic','UTF-8','XHTML','XHTML Basic');
>> >>
>> >>
>> >> Thanks,
>> >> shinsuke
>> >>
>> >>
>> >> (Jay) Jun Yan wrote:
>> >> > I use Tomcat 5.5.
>> >> >
>> >> > I am not sure how pipeline parameters are encoded as a part of URL,
>> >> but
>> >> if
>> >> > they were always encoded in ISO-8895-1, that would be wrong, as
>> that
>> >> would
>> >> > make to pass unicodes in URL impossible. On the contrary, if they
>> were
>> >> > encoded in UTF-8, everybody would be happy.
>> >> >
>> >> > Any encoding related calls should use a customizable encoding, if
>> >> > situations
>> >> > like that UTF-8 is not good enough in the future are considered.
>> >> Otherwise,
>> >> > to use a hardcoded "UTF-8" would be better to use a haredcoded
>> >> "ISO-8895-1"
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Jay
>> >> >
>> >> >
>> >> > On 7/22/06, Shinsuke SUGAYA <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> I'm not sure what web container you use.. But if I remember
>> >> correctly,
>> >> >> usually, parameters will be parsed by ISO-8859-1 to get pipeline
>> >> >> parameter.
>> >> >>
>> >> >> Thanks,
>> >> >> shinsuke
>> >> >>
>> >> >> (Jay) Jun Yan wrote:
>> >> >> > I am using Jetspee 2.0
>> >> >> >
>> >> >> > In org.apache.jetspeed.engine.servlet.ServletRequestImpl. 348855
>> >> >> > 2005-11-25
>> >> >> > 02:36:22Z ate
>> >> >> > Method getParameterMap, there is a line
>> >> >> > paramValues[i] = new
>> >> String(paramValues[i].getBytes("ISO-8859-1"),
>> >> >> > encoding);
>> >> >> >
>> >> >> > This is probably wrong, as it assumes parameters are ISO-8859-1
>> >> >> encoded,
>> >> >> > and
>> >> >> > that will cause UTF-8 encoded parameters, like
>> >> >> > request.jsp?name=%E9%A1%B9%E7%9B%AE
>> >> >> >
>> >> >> > be understood as "??", while actually it should be "项目"
>> >> (Project in
>> >> >> > Chinese)
>> >> >> >
>> >> >> > I changed it to use UTF-8 at my place.
>> >> >> >
>> >> >> > Any suggestion/comments?
>> >> >> >
>> >> >> > Thanks,
>> >> >> >
>> >> >> > Jay
>> >> >> >
>> >> >>
>> >> >> --------------------------------------
>> >> >> Let's start Yahoo! Auction - Free Campaign Now!
>> >> >> http://pr.mail.yahoo.co.jp/auction/
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> >> >> For additional commands, e-mail:
>> >> [EMAIL PROTECTED]
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --------------------------------------
>> >> Let's start Yahoo! Auction - Free Campaign Now!
>> >> http://pr.mail.yahoo.co.jp/auction/
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]