From 72e6b002021e45255f568fc0c885d82de75ae935 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Thu, 18 Sep 2008 01:07:32 +0400 Subject: git-gui: Cleanup handling of the default encoding. - Make diffs and blame default to the system (locale) encoding instead of hard-coding UTF-8. - Add a gui.encoding option to allow overriding it. - gitattributes still have the final word. The rationale for this is Windows support: 1) Windows people are accustomed to using legacy encodings for text files. For many of them defaulting to utf-8 will be counter-intuitive. 2) Windows doesn't support utf-8 locales, and switching the system encoding is a real pain. Thus the option. This patch also adds proper encoding conversion to Apply Hunk/Line. Signed-off-by: Alexander Gavrilov Tested-by: Johannes Sixt Signed-off-by: Shawn O. Pearce --- lib/blame.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/blame.tcl') diff --git a/lib/blame.tcl b/lib/blame.tcl index 7535adb97d..84d55b5828 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -402,7 +402,7 @@ method _load {jump} { fconfigure $fd \ -blocking 0 \ -translation lf \ - -encoding [tcl_encoding [gitattr $path encoding UTF-8]] + -encoding [get_path_encoding $path] fileevent $fd readable [cb _read_file $fd $jump] set current_fd $fd } -- cgit v1.2.3