You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Eugen Paraschiv <ha...@gmail.com> on 2011/07/09 14:47:30 UTC

[lang]

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.

Re: [lang]

Posted by Gary Gregory <ga...@gmail.com>.
Examples would help yes ;)

Gary

On Jul 9, 2011, at 11:40, Eugen Paraschiv <ha...@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


Re: [lang]

Posted by Henri Yandell <fl...@gmail.com>.
>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 <ha...@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