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

Make string2byte conversions indepedent of platform default encoding

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.4
    • None
    • any platform whose default encoding is not a superset of ASCII, e.g. UTF-16 or EBCDIC

    Description

      Both the library itself and many of its tests are utterly dependent on the JVM's default charset. For example, DigestUtils calls String.getBytes() to convert an input string to a byte array, happily delivering different digests for the same input string if run on different platforms.

      If you want to try out the havor yourself, just run the unit tests in a JVM with UTF-16, e.g. by adding the line

      <argLine>-Dfile.encoding=UTF-16</argLine>
      

      to the configuration of the Surefire Plugin in the POM.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            bentmann Benjamin Bentmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment