Closed deathaxe closed 4 years ago
From my research it doesn't seem like i18n.filesencoding
is a standard git setting. The gui.encoding
config or the encoding
attribute are used to tell git gui applications which encoding to use. The Hunk staging not working is definitely a bug though, thanks for finding that.
Honestly, didn't investigate that in detail. Git for Windows and GitExtensions are installed on my box. Maybe the latter one added it to the config.
Fixed in SM 2009
Version info
Description
One of my repositories contains ANSI encoded files as the corresponding engineering application is from the 90's and doesn't know about utf-8. Therefore the
i18n.filesencoding=Windows-1252
is set in the repositories .git/config file.Steps to reproduce
When saving the Windows-1252 encoded H5.asc file the diffs are displayed corectly.
When hitting "Stage" or
git add H5.asc
everything works as expected as well.When hitting "Stage Hunk" (instead of "stage" from step 2), the corresponding hunk looks like utf-8 encoded but displayed as ANSI in the staging area.
At the same time, all lines containing none-ascii characters like
ä
,ö
,ß
, etc. are slightly highlighted in the working directory, too, even though the content looks equal and correct on both panes.If hitting "Unsage Hunk" for the former staged hunk git fails with an error message.
I guess it detects conflicts due to changed encodings?
Expected behavior
Staging/Unstaging hunks should handle all file-encodings gracefully and respect the
i18n.filesencoding
setting.Debug Info