Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/4] test-lib.sh: add test_utf8() function

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:21

Yann Droneaud [off-list ref] writes:
+# check UTF-8 locale availability
+test_utf8 () {
+    if test_have_prereq PERL ; then
+	# output an en_US.UTF-8 locale compatible name
+	GIT_LC_UTF8=`$PERL_PATH $GIT_BUILD_DIR/t/lib-locale.pl`
+    fi
+    if test -z "$GIT_LC_UTF8" ; then
+	return 1
+    else
+	test_set_prereq UTF8
+	return 0
+    fi
+}
Nice abstraction to have a helper function that picks a locale to be used
when we want to test UTF-8 thingy.  Perhaps pick_utf8_locale might be a
better name, though. 

The comment in the function is not wrong per-se, but it and the
implementation in 1/4 may be too restrictive---all it needs to do is to
pick a locale that is UTF-8, and it does not necessarily have to be en_US,
no?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help