commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <flame...@gmail.com>
Subject Re: [lang]
Date Sat, 09 Jul 2011 19:00:42 GMT
>From the 3.0 javadoc:

"Note that unicode characters greater than 0x7f are as of 3.0, no
longer escaped. "

Not that informative on how to fix it I know. Here's the latest,
unpublished javadoc:

http://people.apache.org/~bayard/commons-lang3-3.0-RC3/site/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#escapeXml%28java.lang.String%29

"Note that unicode characters greater than 0x7f are as of 3.0, no
longer escaped. If you still wish this functionality, you can achieve
it via the following: StringEscapeUtils.ESCAPE_XML.with( new
UnicodeEscaper(Range.between(0x7f, Integer.MAX_VALUE)) );"

So try the following and see if the difference goes away:

    StringEscapeUtils.ESCAPE_XML.with( new
UnicodeEscaper(Range.between(0x7f, Integer.MAX_VALUE)) );

Hen

On Sat, Jul 9, 2011 at 5:47 AM, Eugen Paraschiv <hanriseldon@gmail.com> wrote:
> Hi,
> I have just upgraded my old dependency for commons-lang 2.6 to the new
> 3.0-SNAPSHOT. I'm having some trouble with the XML escaping - with 2.6, the
> StringEscapeUtils.escapeXml method would escape Strings in a certain way.
> Now, my results are completely different (meaning that id simply doesn't
> escape some characters that it used to). Is this behavior expected? Was the
> escaping algorithm changed for 3.0? If so, is there anything I can use to
> keep go back to the original behavior?
> I can provide test cases for each of my different unescaped characters if
> needed.
> Any help is appreciated.
> Thanks.
> Eugen.
>

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


Mime
View raw message