You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2016/12/26 16:47:58 UTC

[jira] [Commented] (TEXT-48) StringEscapeUtils.unescapeEcmaScript: No hexadecimal nor octal encoding supported

    [ https://issues.apache.org/jira/browse/TEXT-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15778642#comment-15778642 ] 

Pascal Schumacher commented on TEXT-48:
---------------------------------------

Issue moved from commons-lang to commons-text, because WordUtils was ported to commons-text and and the commons-lang version will soon be deprecated.

> StringEscapeUtils.unescapeEcmaScript: No hexadecimal nor octal encoding supported
> ---------------------------------------------------------------------------------
>
>                 Key: TEXT-48
>                 URL: https://issues.apache.org/jira/browse/TEXT-48
>             Project: Commons Text
>          Issue Type: Bug
>            Reporter: Jan Peter Stotz
>              Labels: escaping
>
> 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)