Re: [PATCH] gitk: Fix display of copyright symbol in non-utf-8 locales
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 22, 2010, 23:45 UTC
- Message-ID
- <20100322234517.GB2168@progeny.tock>
- In-Reply-To
- <87pr2wc6bo.fsf@fox.patthoyts.tk>
Pat Thoyts wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
Show 7 quoted lines
>> --- a/gitk >> +++ b/gitk >> @@ -1,6 +1,6 @@ >> #!/bin/sh >> # Tcl ignores the next line -*- tcl -*- \ >> -exec wish "$0" -- "$@" >> +exec wish -encoding utf-8 "$0" -- "$@"
[...]
> I would much rather see any fault in the makefile fixed than use > source -encoding in all the various places this script might get > loaded from.
Good point: git-gui.sh does not use ‘source’ but runs the moral equivalent of set wish [info executable] eval exec $wish gitk $revs "--" "--"
to avoid starting a shell. Is it really so expensive to start a shell? This means that, for example, if some insane person were to rewrite gitk in C, then git gui would have to be adjusted before the result could be used.
Show 7 quoted lines
> THere are two characters in this file that are not ASCII > and one of them is in a comment. We could even just use (c) to > simplify this. However, \u00a9 is the correct unicode escape sequence > for tcl to get a copyright character into the script in a way that is > independent of the encoding. The escape sequence should be passed > through unchanged in any translations - tcl wants to see exactly > \u00a9 and everyone is using a copyright glyph here.
So we should fix the Makefile. The problem is that everything Tcl-related seems to assume files it sees will be in either the current locale’s encoding or ISO-8859-1 unless told otherwise, as far as I can tell. The entire gitk source tree, on the other hand, is in UTF-8.
Ideas? Jonathan