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

[PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX

From
Torsten Bögershausen <tboegi@web.de>
Date
Mar 5, 2012, 19:39 UTC
Message-ID
<201203052039.16893.tboegi@web.de>

t0204 tries to use a ISO-8859-1 locale and expects that characters outside the ISO-8859-1 code range are converted in "question marks".

The gettext under Mac OS X ignores the ISO-8859-1 locale and uses UTF-8 anyway.

Fixed even whitespace in this very test case.
Let the test pass when UTF-8 is returned.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 This is a suggestion to make t0204--gettext-reencode-sanity.sh to pass under Mac OSX
 The tests checks if unicode characters outside ISO-8859-1 are converted into '?'.
 The Mac OS X version of gettext does not seem to support ISO-8859-1 at all.
 Even if we set the locale to ISO-8859-1, UTF-8 is used anyway.
 t/t0204-gettext-reencode-sanity.sh |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh
index 189af90..78f0889 100755
--- a/t/t0204-gettext-reencode-sanity.sh
+++ b/t/t0204-gettext-reencode-sanity.sh
@@ -27,16 +27,22 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT
 '
 
 test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '
-    LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Old English Runes" >runes &&
+	LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Old English Runes" >runes &&
 
 	if grep "^TEST: Old English Runes$" runes
 	then
 		say "Your system can not handle this complexity and returns the string as-is"
 	else
-		# Both Solaris and GNU libintl will return this stream of
-		# question marks, so it is s probably portable enough
-		printf "TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????" >runes-expect &&
-		test_cmp runes-expect runes
+		if grep "^TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ" runes
+		then
+			# Mac OS supports only UTF-8, even if we want ISO-8859-1 we get UTF-8
+			say "Your system handles only utf-8"
+		else
+			# Both Solaris and GNU libintl will return this stream of
+			# question marks, so it is s probably portable enough
+			printf "TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????" >runes-expect &&
+			test_cmp runes-expect runes
+		fi
 	fi
 '
 
-- 
1.7.9.rc2
Next: Junio C Hamano
Message 1 of 25 in “Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX”
  1. Change t0204-gettext-reencode-sanity.sh to pass under Mac OSXTorsten Bögershausen, Mar 5, 2012
  2. Junio C HamanoMar 5, 2012
  3. Ævar Arnfjörð BjarmasonMar 7, 2012
  4. Junio C HamanoMar 7, 2012
  5. Ævar Arnfjörð BjarmasonMar 7, 2012
  6. Junio C HamanoMar 7, 2012
  7. Ævar Arnfjörð BjarmasonMar 7, 2012
  8. Junio C HamanoMar 7, 2012
  9. Junio C HamanoMar 7, 2012
  10. Torsten BögershausenMar 8, 2012
  11. Johannes SixtMar 8, 2012
  12. Torsten BögershausenMar 8, 2012
  13. Torsten BögershausenMar 8, 2012
  14. Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSXJunio C Hamano, Mar 9, 2012
  15. Torsten BögershausenMar 10, 2012
  16. Junio C HamanoMar 11, 2012
  17. Torsten BögershausenMar 11, 2012
  18. Junio C HamanoMar 11, 2012
  19. Torsten BögershausenMar 11, 2012
  20. Junio C HamanoMar 11, 2012
  21. Torsten BögershausenMar 12, 2012
  22. Junio C HamanoMar 12, 2012
  23. Torsten BögershausenMar 13, 2012
  24. Junio C HamanoMar 13, 2012
  25. Junio C HamanoMar 12, 2012

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.