Suppose I have two files in my git repository with different encodings: UTF-8 and CP866. I have console and etc configured with UTF-8 settings.
I want output of git commands like git diff
or git show
behave properly and don't show something like that:
diff --git a/myfile.tex b/myfile.tex
index 01ad4f3..b1fd24c 100644
--- a/myfile.tex
+++ b/myfile.tex
@@ -220,9 +220,9 @@ centertags]%
-<A3><A4><A5> $f_i \in k[x_1, \ldots , x_n]$, <A8><AC><A5><A5><E2> <E0><A5>襭<A8><A5> $(a_1, \dots, a_n)$. <92><AE><A3><A4><A0> <AF><AE><AB><A8><AD><AE><AC><A8><A0><AB>쭠<EF> <E1><A8><E1>⥬<A0> $\{ R(f_1,f_i) = 0 \}$ <A4><AB><EF> $i = 2, \dots, n$, <A3><A4><A5> $f_i$ <E0><A0><E1>ᬠ<E2>ਢ<A0><A5><E2><E1><EF> <AA><A0><AA> <AF><AE><AB><A8><AD><AE><AC> <AE><E2> $x_n$ <AD><A0><A4> <AA><AE><AB><EC>殬 $k[x_1, \ldots , x_{n-1}]$,
<E1><AE><E1>⮨<E2> <A8><A7> $n-1$ <E3>ࠢ<AD><A5><AD><A8><A9> <AE><E2> <AF><A5>६<A5><AD><AD><EB><E5> $x_1, \dots x_{n-1}$, <A8> <A8><AC><A5><A5><E2> <E0><A5>襭<A8><A5> $(a_1, \dots, a_{n-1})$.
+<A
There is an option to set encoding conversion for all files:
git config --local core.pager "iconv -f cp866 -t utf-8 | less"
git config --local i18n.commitEncoding utf8
git config --local i18n.logoutputencoding cp866
But my goal is to somehow setup encoding conversion per file. I want my UTF-8 file and CP866 file to handle properly.
Is there solution?