commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Peter Stotz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-1217) StringEscapeUtils.unescapeEcmaScript: No hexadecimal nor octal encoding supported
Date Wed, 13 Apr 2016 15:07:25 GMT
Jan Peter Stotz created LANG-1217:
-------------------------------------

             Summary: StringEscapeUtils.unescapeEcmaScript: No hexadecimal nor octal encoding
supported
                 Key: LANG-1217
                 URL: https://issues.apache.org/jira/browse/LANG-1217
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
    Affects Versions: 3.4
            Reporter: Jan Peter Stotz


I encountered several JavaScript/EcmaScript strings that use octal or hexadecimal encoded
characters -  e.g. \042 or \x22 
The only supported encoding variant is "unicode encoding" using "\u" as prefix. 

I tried to unescape them using StringEscapeUtils.unescapeEcmaScript() however that fails as
both encodings are not supported (which is not mentioned).

I searched the net a bit and found the following information:
Octal encoding is still used around the net but has been removed in EC5: https://mathiasbynens.be/notes/javascript-escapes#octal

Hexadecimal escape sequences however seems to be still allowed in EC5 and EC6:
https://mathiasbynens.be/notes/javascript-escapes#hexadecimal



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message