commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "polygenelubricants (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-646) StringEscapeUtils.unescapeJava doesn't handle octal escapes and Unicode with extra u
Date Sun, 22 Aug 2010 17:55:16 GMT

     [ https://issues.apache.org/jira/browse/LANG-646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

polygenelubricants updated LANG-646:
------------------------------------

    Description: 
(Note: there seems to be a bug in the issue tracker where a double backslash is rendered as
newline separator instead.)

CODE TO REPRODUCE BUG:

{noformat}
System.out.println(
"\45".equals(StringEscapeUtils.unescapeJava("\\45"))
); // false

System.out.println(
StringEscapeUtils.unescapeJava("\\uu0030")
); // throws NestableRuntimeException:
{noformat}

This is not compliant with the JLS, which allows both [OctalEscape] and extraneous u for [UnicodeMarker]
in Java string literal.

REFERENCES:

3.10.6 Escape Sequences for Character and String Literals
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6

3.3 Unicode Escapes
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3

EXTERNAL LINKS:

http://stackoverflow.com/questions/3537706/howto-unescape-a-java-string-literal-in-java/

  was:
(Note: there seems to be a bug in the issue tracker where a double backslash is rendered as
newline separator instead.)

CODE TO REPRODUCE BUG:

System.out.println(
"\45".equals(StringEscapeUtils.unescapeJava("\\45"))
); // false

System.out.println(
StringEscapeUtils.unescapeJava("\\uu0030")
); // throws NestableRuntimeException:

This is not compliant with the JLS, which allows both [OctalEscape] and extraneous u for [UnicodeMarker]
in Java string literal.

REFERENCES:

3.10.6 Escape Sequences for Character and String Literals
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6

3.3 Unicode Escapes
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3

EXTERNAL LINKS:

http://stackoverflow.com/questions/3537706/howto-unescape-a-java-string-literal-in-java/


> StringEscapeUtils.unescapeJava doesn't handle octal escapes and Unicode with extra u
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-646
>                 URL: https://issues.apache.org/jira/browse/LANG-646
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 2.5
>         Environment: Irrelevant
>            Reporter: polygenelubricants
>            Priority: Minor
>
> (Note: there seems to be a bug in the issue tracker where a double backslash is rendered
as newline separator instead.)
> CODE TO REPRODUCE BUG:
> {noformat}
> System.out.println(
> "\45".equals(StringEscapeUtils.unescapeJava("\\45"))
> ); // false
> System.out.println(
> StringEscapeUtils.unescapeJava("\\uu0030")
> ); // throws NestableRuntimeException:
> {noformat}
> This is not compliant with the JLS, which allows both [OctalEscape] and extraneous u
for [UnicodeMarker] in Java string literal.
> REFERENCES:
> 3.10.6 Escape Sequences for Character and String Literals
> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6
> 3.3 Unicode Escapes
> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3
> EXTERNAL LINKS:
> http://stackoverflow.com/questions/3537706/howto-unescape-a-java-string-literal-in-java/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message