Diff shown wrong when file encoding is changed (win-1251 -> UTF-8)

Issue #10097 resolved
Anton Sukhinov
created an issue

I had files with win-1251 encoding. These files were shown as «binary» in web-interface. That is not a problem per se, since we can define binary file as «file which is not UTF-8 compliant».

The problem appeared when I converted these files to UTF-8. For this commit these files are listed in the list «Files changed», but differences for the files are displayed as «File contents unchanged». That can make me think that files are really not changed.

Moreover, for one short file the differences were displayed, and they look like that I changed readable to non-readable text (but in fact I changed non-readable to readable).

P.S. In SourceTree differences are displayed correctly.

Comments (2)

  1. Erik van Zijst staff

    As you correctly guessed, Bitbucket takes a relatively primitive approach to distinguishing between displayable text and binary by looking for null bytes and so anything in UTF-8 should always work, but other encodings (including UTF-16) don't.

    Moreover, for one short file the differences were displayed, and they look like that I changed readable to non-readable text (but in fact I changed non-readable to readable).

    That sounds strange and is something we can open a support case through https://bitbucket.org/support if you want.

  2. Log in to comment