gitk: Enhance file encoding support
commit09c7029dfa58748268a6306bfe764456a65a22bf
authorAlexander Gavrilov <angavrilov@gmail.com>
Mon, 13 Oct 2008 08:12:31 +0000 (13 12:12 +0400)
committerPaul Mackerras <paulus@samba.org>
Tue, 14 Oct 2008 11:25:54 +0000 (14 22:25 +1100)
tree786abfb4e5f9b3ed0c9c5a12b755596888bfccbe
parent3945d2c05226d6c380a4f1b70f11941a6503a97e
gitk: Enhance file encoding support

This allows the encoding to be specified for file contents and used
when displaying files and diffs in the bottom-left pane.  When
displaying diffs, the encoding for each diff hunk is that for the file
that the diff hunk is from, so it can change through the course of the
diff.

The encoding for file contents is determined as follows:

- File encoding defaults to the system encoding.
- It can be overridden by setting the gui.encoding option.
- Finally, the 'encoding' attribute is checked on
  per-file basis; it has the last word.

Note: Since git-check-attr does not provide support for reading
attributes from trees, attribute lookup is done using files from the
working directory.

This also extends the range of supported encoding names, adding
ShiftJIS and Shift-JIS as aliases for Shift_JIS, and allowing
cp-*, cp_*, ibm-*, ibm_*, jis-* and jis_* as aliases for cp*,
ibm* and jis* respectively.

This also fixes some bugs in handling of non-ASCII filenames.  Core
git apparently supports only locale-encoded filenames, so processing
is done using the system encoding.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk