Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-371

Converting line endings corrupts ISO-8859-1 files when platform encoding is UTF-8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2-beta-2, 2.2
    • 2.4
    • None
    • None
    • Linux with platform encoding set to UTF-8

    Description

      Converting line endings for a text file encoded in ISO-8859-1 replaces any character in the set above ASCII with the three characters ᅵ.
      What happens is that the file to be converted is read as text in the platform encoding (seems to be method readFile in class FileFormatter), and when the platform encoding is UTF-8, any non-ASCII character from ISO-8859-1 is converted to the UTF-8 character "�" (i.e. the placeholder for unknown / broken character).

      I've attached a small sample project that shows this problem on Linux with platform encoding set to UTF-8.

      I see two possible fixes for this, one is to read the file as bytes and do a search /replace for line endings, and the other is to be able to specify encoding for a fileset or file.

      Attachments

        1. assembly-encoding.zip
          2 kB
          Håvard Wigtil

        Activity

          People

            dennisl@apache.org Dennis Lundberg
            havwig Håvard Wigtil
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: