Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8357

EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" when meets \t \r

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.12
    • 2.4.13
    • groovy-runtime
    • None

    Description

      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"
      // \t \n \r
      + "\u0042\u0042\u0041\u0041\u0042\u0042\u0041\u0042"
      ...
      I mark them in color.
      I believe it's an offset mistake.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              xingplus Xin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: