bug-parted
[Top][All Lists]
Advanced

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

bug#18258: t0251-gpt-unicode.sh fails when the C.UTF-8 locale is unavail


From: Brian C. Lane
Subject: bug#18258: t0251-gpt-unicode.sh fails when the C.UTF-8 locale is unavailable
Date: Wed, 13 Aug 2014 13:59:44 -0700
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Aug 13, 2014 at 09:55:26PM +0200, Ludovic Courtès wrote:
> The test could look for a valid UTF-8 locale like this:
> 
> --8<---------------cut here---------------start------------->8---
> found_locale=no
> for locale in en_US de_DE fr_FR es_ES
> do
>   LC_ALL="$locale.utf8"
> 
>   # In a UTF-8 locale, the string below prints as 4 characters.
>   if [ `printf 'foo\341\264\244' | wc -m` -eq 4 ]; then
>     found_locale=yes
>     break
>   fi
> done
> 
> if [ "$found_locale" != "yes" ]; then
>   echo "no valid UTF-8 locale found; skipping" >&2
>   exit 77
> fi
> --8<---------------cut here---------------end--------------->8---
> 
> Thoughts?

Nice! I like that better.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]