git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Pat ThoytsNext: Jonathan Nieder
Message 7 of 10 in “gitk: Avoid calling tk_setPalette on Windows”
  1. 1/3 gitk: Avoid calling tk_setPalette on WindowsPat Thoyts, Mar 12, 2010
  2. 2/3 gitk: Add emacs editor variable block.Pat Thoyts, Mar 12, 2010
  3. 3/3 gitk: fix display of copyright symbolPat Thoyts, Mar 12, 2010
  4. gitk: Fix display of copyright symbol in non-utf-8 localesJonathan Nieder, Mar 20, 2010
  5. gitk: Update makefile to keep -encoding option for gitk-wishJonathan Nieder, Mar 20, 2010
  6. Pat ThoytsMar 22, 2010
  7. Jonathan NiederMar 22, 2010
  8. Jonathan NiederMar 20, 2010
  9. Pat ThoytsMar 22, 2010
  10. Jonathan NiederMar 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.