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

Bitbucket has trouble viewing files with UTF-16

    XMLWordPrintable

Details

    Description

      Bitbucket seems to have trouble viewing and diffing files of various encodings.
      I created a git repo, committed a bunch of files with different encodings, then attempted to view them via the file browser in Bitbucket. Some of the files render with a special character shown, some don't render at all.

      Then I branched, made changes to each file, committed and made a pull request. Most of the files had trouble rendering in the diff and instead bitbucket showed "This file cannot be rendered in your browser".

      Here's some results. I've attached the git repository that I originally uploaded to our Bitbucket instance to perform the tests.

      File Encoding Result file command result
      test-utf8.txt UTF-8 Good ASCII text, with CRLF line terminators
      test-utf8bom.txt UTF-8 with BOM Displays \ufeff char at beginning of direct view, and during pull request diff. Diff renders correct otherwise UTF-8 Unicode (with BOM) text, with CRLF line terminators
      test-utf16le.txt UTF-16 LE Can't be displayed directly nor can it be displayed in pull request diff data
      test-utf16lebom.txt UTF-16 LE with BOM Displays \ufeff char at beginning of direct view. Diff renders only if transcoding is enabled. Little-endian UTF-16 Unicode text, with CRLF line terminators
      test-utf16be.txt UTF-16 BE Can't be displayed directly nor can it be displayed in pull request diff data
      test-utf16bebom.txt UTF-16 BE with BOM Displays \ufeff char at beginning of direct view. Diff renders only if transcoding is enabled. Big-endian UTF-16 Unicode text, with CRLF line terminators

      Environment:

      • Server
        • Bitbucket Server 4.0.2
        • cat /etc/redhat-release 
          Red Hat Enterprise Linux Server release 7.1 (Maipo)
        • uname -a
          3.10.0-229.11.1.el7.x86_64 #1 SMP Wed Jul 22 12:06:11 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
      • Client (where I created the files)
        • Windows 7 Enterprise SP1 64-bit
        • Sublime Text 3.3103
        • SourceTree 1.8.2.2 with embedded Git 1.9.5

      Attachments

        1. cannot_render.png
          cannot_render.png
          19 kB
        2. encoding-test.zip
          10 kB
        3. ueff_character_pullrequest.png
          ueff_character_pullrequest.png
          17 kB

        Issue Links

          Activity

            People

              colivier Charles Olivier (Inactive)
              65c73e965862 Rob Nelson
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: