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

git log and utf-u in filenames

From
Joey Hess <joey@kitenet.net>
Date
Sep 25, 2008, 21:50 UTC
Message-ID
<20080925215002.GA30810@kodama.kitenet.net>

Git, particularly git-log seems to not display utf-8 characters in filenames, instead showing an escaped representation. On the other hand, commit messages, as git-log(1) notes, are assumed to be utf-8, and the same utf-8 character used in a commit message is not escaped, and displays ok.

Can anyone point me at the documentation for this utf-8 filename escaping, assuming it's not a bug? And did earlier versions of git (circa 2006) perhaps not do that escaping? I have code in ikiwiki that apparently used to work, but is certianly not working with current git, due to this escaping.

Here's an example of the inconsistent handling of the same utf-8 character ("ö") in commit messages and filenames.

joey@kodama:~/tmp>mkdir utf8; cd utf8; git-init
Initialized empty Git repository in /home/joey/tmp/utf8/.git/
joey@kodama:~/tmp/utf8>echo hi > ö
joey@kodama:~/tmp/utf8>git add ö; git commit -m 'adding file: ö'
Created initial commit ee7d809: adding file: ö
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 "\303\266"
joey@kodama:~/tmp/utf-8>git log --stat
commit ee7d809d1811b1e1ad485ce3e7274316257029ae
Author: Joey Hess <joey@kodama.kitenet.net>
Date:   Thu Sep 25 17:34:10 2008 -0400
       
          adding file: ö
       
 "\303\266" |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
-- 
see shy jo
Next: Joey Hess
Message 1 of 8 in “git log and utf-u in filenames”
  1. Joey HessSep 25, 2008
  2. Joey HessSep 25, 2008
  3. Jakub NarebskiSep 25, 2008
  4. Alex RiesenSep 26, 2008
  5. Jakub NarebskiSep 26, 2008
  6. Alex RiesenSep 26, 2008
  7. Jakub NarebskiSep 27, 2008
  8. Jakub NarebskiSep 25, 2008

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.