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

Base64 default constructor behaviour changed to enable chunking in 1.4

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.5
    • None

    Description

      The following test passes in commons-codec 1.3 but fails in 1.4:

      public void testObjectEncode() throws Exception {
          Base64 b64 = new Base64();
          assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes())));
      }
      

      Commons-codec 1.3 returns "SGVsbG8gV29ybGQ=".

      Commons-codec 1.4 returns "SGVsbG8gV29ybGQ=\r\n".

      I'd understand if you want to close this as "Won't Fix", since the behaviour wasn't documented before (the constructor wasn't even present!) and now it is.

      However, there is still no test for this behaviour on trunk as far as I can tell, so it would be good to add one so it doesn't change again in the future. I'll attach a patch for Base64Test which you can apply on trunk which will do so.

      Attachments

        1. Base64Test-mryall-1.patch
          0.8 kB
          Matt Ryall

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mjryall Matt Ryall
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: