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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yann Droneaud <yann@xxxxxxxxxxx> 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?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]