+5

File compare: charset file encoding indication

Seb D 8 years ago updated by Marc Strapetz 3 years ago 6

As a user I wish I could see the guessed charset encoding of each file in the File Compare tool of Smartgit. And eventually in the Conflict Solver tool of  Smartgit.


When one accidentally changes the encoding of the file, the asked for feature would help to detect such a mistake. A different encoding should be highlighted similar to other diffs to easily spot the mistake.

Alternatively, regarding the problem of accidentally saving a file in the wrong encoding and not discovering the mistake because SmartGit diff view does not show a change although certain bytes in the file might have changed, an option similar to the lowe-level property text.detectUtf8WithoutBOM could help. One that semantically means "always honor the 'Text File Encoding' setting of the project", preventing SmartGit from ever trying to guess the character encoding of a file.

In fact, I stumbled over just this issue. Took me quite a while to sort out what had happened...

Where exactly you want to see the encoding being displayed, especially in the Changes view?

It usually covers not just the encoding, but also line separators - both 'invisible' text file properties.

I could imagine adding an extra line on top of the file - that would be obvious but not too intrusive and allow the same representation in all diff views, including the index editor. Also, it could offer the same intuitive interactions that exist for other differences.


For line endings that will require some more thought, because it may be "normal" to have the checked-in version different from the working tree. Also "normal" depends on the operating system and the git config - offering clear UI support for the CRLF setting, however, would be a tremendous improvement, far beyond the "small detail" of file encodings.

Just found this conversation by search.  I'm contributing to a project on GitHub, and had to redo a pull request because I hadn't noticed a code page conflict. Because I was now paying close attention to file encoding issues, I noticed that the SmartGit side-by-side diff viewer is apparently using UTF-8, and I can't find any way to change that.  The project I'm contributing to is fairly old - mid-1990s - and the files use code page 437 (Windows default in US.)  A German name in one of the files contains a lower-case o-umlaut, but SmartGit is showing it as a right double-quote (not the neutral double quote from the US keyboard.)

You can configure the encoding in Repository|Settings .