-
Bug
-
Resolution: Duplicate
-
Low
-
None
-
4.0.2
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
- duplicates
-
BSERV-8428 Harden diff parsing for files with CR (^M) line endings that "git diff" does not support
- Closed
-
BSERV-7323 German Umlaut characters display incorrectly in diff view
- Gathering Impact
- is incorporated by
-
BSERV-8428 Harden diff parsing for files with CR (^M) line endings that "git diff" does not support
- Closed
- relates to
-
BSERV-3179 Convert non-UTF8 files to UTF8 before generating the diff view
- Closed