Diff not working on UTF-16 LE files without BOM

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 3.2.2
    • Component/s: Git
    • None
    • Severity 2 - Major

      Files encoded with UTF-16 LE (little endian) without BOM (Byte Order Mark) does not display correctly. Every other character is displayed as a space (see screenshot).

      To reproduce:

      1. Save a text file as "sample.txt" in a git repository with encoding of UTF-16LE (without BOM)
        1. To do this I use the SublimeText3 "Save with encoding" feature
      2. Add the line
        **/*sample.txt text working-tree-encoding=UTF-16LE

        to the ".gitattributes" file which should let Git understand how to interpret the file. (this should make it show up correctly)

      3. Look at the file in the diff view in source tree (see screenshot)

      Screenshot:

      To verify fix:

      1. make sure that the diff view now works with files that are encoded with BOTH of the following encodings:
        1. UTF-16 LE (without BOM)
        2. UTF-16 LE BOM (WITH BOM)

       

            Assignee:
            Unassigned
            Reporter:
            Bjarne Svanberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: