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

BaseNCodec uses UTF-8 rather than US_ASCII for byte conversions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      According to RFC 4648 [1], base32 and base64 should use the US-ASCII charset.
      However, the code currently uses UTF-8.

      This should not make a difference when converting from byte[] to String, because the bytes will always be US-ASCII.

      However, depending on how the conversion treats characters which are UTF-8 but not ASCII, it could affect the behaviour when decoding non-ASCII strings.

      Should the code use newStringUsAscii(byte[])/getBytesUsAscii(String) throughout?
      Some of the Javadoc will need adjusting if so.

      [1] http://tools.ietf.org/html/rfc4648

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: