Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9708

1 line non-UTF8 file gets garbled

XMLWordPrintable

      Summary

      Non-utf8 characters are garbled if file only contains 1 line.

      Environment

      Steps to Reproduce

      • Activate diff transcoding
        1. Commit and push 1 line non-utf8 file
        2. Check the added file gets corrupt
      • Deactivate diff transcoding
        1. Commit and push 1 line non-utf8 file
        2. Check the added file gets corrupt

      I've attached the file non_utf8.zip which is used for verification.

      $ find . -type f -name "*.txt" | xargs nkf --guess
      ./1.1.txt: Shift_JIS (LF)
      ./1.txt: Shift_JIS (LF)
      ./2.1.txt: EUC-JP (LF)
      ./2.txt: EUC-JP (LF)
      ./3.1.txt: EUC-JP (LF)
      ./3.txt: EUC-JP (LF)
      

      Expected Results

      Source view correctly shows 1 line file as well as multi lines file.

      Actual Results

      - 1 line file Multi lines file
      Transcode-enabled Source view
      Diff to previous
      Source view
      Diff to previous
      Transcode-disabled Source view
      Diff to previous
      Source view
      Diff to previous

      Workaround

      • None

              Unassigned Unassigned
              kyamamoto@atlassian.com K. Yamamoto
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: