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

[PATCH ] t4210-log-i18n: spell encoding name "UTF-8" correctly

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 25, 2013, 08:37 UTC
Message-ID
<512B22DE.9070603@viscovery.net>
In-Reply-To
<20130211205958.GA32740@sigill.intra.peff.net>
From: Johannes Sixt <j6t@kdbg.org>

iconv on Windows does not know the encoding name "utf8", and does not re-encode log messages when this name is given. Request "UTF-8" encoding.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 I'm not sure whether I'm right to say that "UTF-8" is the correct
 spelling. Anyway, 'iconv -l' on my old Linux box lists "UTF8", but on
 Windows it does not.
 A more correct fix would probably be to use is_encoding_utf8() in more
 places, but it's outside my time budget look after it.
 -- Hannes
 t/t4210-log-i18n.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh
index 52a7472..b1956e2 100755
--- a/t/t4210-log-i18n.sh
+++ b/t/t4210-log-i18n.sh
@@ -15,7 +15,7 @@ test_expect_success 'create commits in different encodings' '
 	t${utf8_e}st
 	EOF
 	git add msg &&
-	git -c i18n.commitencoding=utf8 commit -F msg &&
+	git -c i18n.commitencoding=UTF-8 commit -F msg &&
 	cat >msg <<-EOF &&
 	latin1
 
@@ -30,7 +30,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
 	latin1
 	utf8
 	EOF
-	git log --encoding=utf8 --format=%s --grep=$utf8_e >actual &&
+	git log --encoding=UTF-8 --format=%s --grep=$utf8_e >actual &&
 	test_cmp expect actual
 '
 
@@ -45,7 +45,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
 
 test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
 	>expect &&
-	git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
+	git log --encoding=UTF-8 --format=%s --grep=$latin1_e >actual &&
 	test_cmp expect actual
 '
 
-- 
"Atomic objects are neither active nor radioactive." --
Programming Languages -- C++, Final Committee Draft (Doc.N3092)
Previous: Jeff KingNext: Jeff King
Message 17 of 26 in “segfault for git log --graph --no-walk --grep a”
  1. Thomas HallerFeb 8, 2013
  2. Junio C HamanoFeb 9, 2013
  3. Junio C HamanoFeb 9, 2013
  4. Jeff KingFeb 9, 2013
  5. Junio C HamanoFeb 9, 2013
  6. Junio C HamanoFeb 9, 2013
  7. Jeff KingFeb 9, 2013
  8. Jeff KingFeb 9, 2013
  9. Jeff KingFeb 11, 2013
  10. Junio C HamanoFeb 11, 2013
  11. Junio C HamanoFeb 11, 2013
  12. Jeff KingFeb 11, 2013
  13. Junio C HamanoFeb 11, 2013
  14. log: re-encode commit messages before greppingJeff King, Feb 11, 2013
  15. Junio C HamanoFeb 11, 2013
  16. Jeff KingFeb 11, 2013
  17. t4210-log-i18n: spell encoding name "UTF-8" correctlyJohannes Sixt, Feb 25, 2013
  18. Jeff KingFeb 25, 2013
  19. Junio C HamanoFeb 25, 2013
  20. Jeff KingFeb 25, 2013
  21. Johannes SixtFeb 26, 2013
  22. Torsten BögershausenFeb 25, 2013
  23. Torsten BögershausenFeb 25, 2013
  24. Jeff KingFeb 25, 2013
  25. Junio C HamanoFeb 9, 2013
  26. Jeff KingFeb 9, 2013

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.