at 15.09-beta 34 lines 928 B view raw
1From Ludo's suggestion at: 2 3 http://debbugs.gnu.org/cgi/bugreport.cgi?msg=8;bug=18258 4 5diff --git a/tests/t0251-gpt-unicode.sh b/tests/t0251-gpt-unicode.sh 6index c845950..fa63a72 100755 7--- a/tests/t0251-gpt-unicode.sh 8+++ b/tests/t0251-gpt-unicode.sh 9@@ -22,7 +22,24 @@ dev=loop-file 10 # create zeroed device 11 truncate -s 10m $dev || fail=1 12 13-export LC_ALL=C.UTF-8 14+found_locale=no 15+for locale in en_US de_DE fr_FR es_ES 16+do 17+ LC_ALL="$locale.UTF-8" 18+ export LC_ALL 19+ 20+ # In a UTF-8 locale, the string below prints as 4 characters. 21+ if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then 22+ found_locale=yes 23+ break 24+ fi 25+done 26+ 27+if [ "$found_locale" != "yes" ]; then 28+ echo "no valid UTF-8 locale found; skipping" >&2 29+ exit 77 30+fi 31+ 32 # create gpt label with named partition 33 part_name=$(printf 'foo\341\264\244') 34 parted -s $dev mklabel gpt mkpart primary ext2 1MiB 2MiB name 1 $part_name > empty 2>&1 || fail=1