groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8357) EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" when meets \t \r
Date Sun, 29 Oct 2017 15:31:00 GMT

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

Xin commented on GROOVY-8357:
-----------------------------

yes:
{color:#f79232}'\r'.decodeBase64(){color} will throw a RuntimeException(bad character in base64
value)
{color:#f79232}'\n'.decodeBase64(){color} won't

> EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" when meets
\t \r
> --------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8357
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8357
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.4.x
>            Reporter: Xin
>
> EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" RuntimeException
when the method meets \t \r character.
> I found in org.codehaus.groovy.runtime.EncodingGroovyMethodsSupport.TRANSLATE_TABLE has
a mistake:
>     static final byte[] TRANSLATE_TABLE = (
>             "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
>                     //                    {color:red}\t{color}    {color:yellow}\n{color}
               {color:blue}\r{color}
>                     + "\u0042{color:red}\u0042{color}{color:yellow}\u0041{color}\u0041\u0042{color:blue}\u0042{color}\u0041\u0042"
> ...
> I mark them in color.
> I believe it's an offset mistake.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message