sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

UTF-16 text files treated as binary files

Open yurikus opened this issue 2 years ago • 6 comments

Problem description

UTF-16 text files treated as binary files

Preferred solution

Treat UTF-16 text files treated as text

Screenshots image

yurikus avatar Oct 30 '22 21:10 yurikus

Also noted that issue, already.

deathaxe avatar Oct 31 '22 13:10 deathaxe

Isn't this (for me also annoying) default behavior of git?

themilkman avatar Oct 31 '22 17:10 themilkman

It may be, but we're looking at a GUI tool here, which should be a bit smarter, IMHO :) Forces me to reach for beyond compare

yurikus avatar Oct 31 '22 17:10 yurikus

There are various ways to tell git to treat .strings files (which are UTF-16 with BOM encoded) as text files as far as diff is concerned. Our repo has this .gitattributes file at its root:

*.strings diff=utf16

And any changes to .strings files show up as text diffs. However Sublime Merge doesn't seem to know about this setting. There's a discussion of this on stackoverflow.

pcbeard avatar Dec 11 '23 18:12 pcbeard

In the recent version, unstaged UTF16 files are still treated as binary, however as soon as you stage them, they are diffed properly.

yurikus avatar Dec 11 '23 18:12 yurikus

In the recent version, unstaged UTF16 files are still treated as binary, however as soon as you stage them, they are diffed properly.

I have just tried this on UTF-16 with BOM (using build 2091), and unfortunately this did not work. Where can we "upvote" the issue?

tlindeb avatar Dec 19 '23 17:12 tlindeb