You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2005/03/08 23:14:39 UTC

Re: [lang] Bugs of StringEscapeUtils.escapeHtml()?

Is that a problem?
Stephen

----- Original Message ----- 
From: "Carfield Yim" <ca...@gmail.com>
> Other than escapeHTML entities like space and < , all multibyte
> Characters like Chinese, Japanese and Russian will escaped.


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


Re: [lang] Bugs of StringEscapeUtils.escapeHtml()?

Posted by Henri Yandell <fl...@gmail.com>.
Relatively clueless about the code (Gary and Alex were the main
authors, Alex isn't very active now).

If I'm understanding correctly, then the issue is that the code is
escaping values that are not specifically listed in the spec listed
below. Scanning the code, it looks like the cause is on line 611 of
the current version, if entityName is null (ie it is not specified)
and it is > 0x7f, then it escapes the value as a number. The same
issue I presume is in the unescape side.

Given that the code is pretty focused on display by a browser, failure
to fit IE and Firefox's feature-set seems like a pretty critical
problem.

Still. I think it's going to be better to work on a 2.1 release and
then focus on this issue, than to try and squeeze this one in just
before release. If you can provide a patch and unit test, then I'm
sure we'll be able to apply it to head as soon as the release goes
out. Otherwise a bug report would still be great and it'll be gotten
to eventually.

Hen

On Wed, 9 Mar 2005 11:28:17 +0800, Carfield Yim <ca...@gmail.com> wrote:
> I guess so.... seem IE and firefox won't change the escaped multibyte
> characters back to human readable character to our user. And see it is
> not fit to the specification?
> 
> http://www.w3.org/TR/REC-html40/sgml/entities.html
> 
> On Tue, 8 Mar 2005 22:14:39 -0000, Stephen Colebourne
> <sc...@btopenworld.com> wrote:
> > Is that a problem?
> > Stephen
> >
> > ----- Original Message -----
> > From: "Carfield Yim" <ca...@gmail.com>
> > > Other than escapeHTML entities like space and < , all multibyte
> > > Characters like Chinese, Japanese and Russian will escaped.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

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


Re: [lang] Bugs of StringEscapeUtils.escapeHtml()?

Posted by Carfield Yim <ca...@gmail.com>.
I guess so.... seem IE and firefox won't change the escaped multibyte
characters back to human readable character to our user. And see it is
not fit to the specification?

http://www.w3.org/TR/REC-html40/sgml/entities.html


On Tue, 8 Mar 2005 22:14:39 -0000, Stephen Colebourne
<sc...@btopenworld.com> wrote:
> Is that a problem?
> Stephen
> 
> ----- Original Message -----
> From: "Carfield Yim" <ca...@gmail.com>
> > Other than escapeHTML entities like space and < , all multibyte
> > Characters like Chinese, Japanese and Russian will escaped.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

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