Uploaded image for project: 'Commons Codec'
  1. Commons Codec
  2. CODEC-263

Base64.decodeBase64 throw exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.13
    • 1.16
    • None
    • JDK 7/JDK 8 

      commons-codec 1.13

    Description

      Codec upgrade to 1.13, code  throw exception as follows:

        @Test
        public  void test(){
          Base64.decodeBase64("publishMessage");
        }
      

      exception like:

      java.lang.IllegalArgumentException: Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value
      
      	at org.apache.commons.codec.binary.Base64.validateCharacter(Base64.java:798)
      	at org.apache.commons.codec.binary.Base64.decode(Base64.java:472)
      	at org.apache.commons.codec.binary.BaseNCodec.decode(BaseNCodec.java:412)
      	at org.apache.commons.codec.binary.BaseNCodec.decode(BaseNCodec.java:395)
      	at org.apache.commons.codec.binary.Base64.decodeBase64(Base64.java:694)
      

      Attachments

        1. image-jpg-01-big.base64.txt
          971 kB
          Sergio Lissner

        Issue Links

          Activity

            People

              Unassigned Unassigned
              geektao xie tao
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: