Re: Help needed with a locale-related issue
On 9/1/15, Francesco Poli <invernomuto@paranoici.org> wrote:
...
> But, if I try the following odd locale configuration (Italian language
> with 'C' locale settings), I get a crash:
>
> $ LANGUAGE='it_IT:it' LC_ALL='C' locale
> LANG=en_US.UTF-8
> LANGUAGE=it_IT:it
> LC_CTYPE="C"
> LC_NUMERIC="C"
> LC_TIME="C"
> LC_COLLATE="C"
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_PAPER="C"
> LC_NAME="C"
> LC_ADDRESS="C"
> LC_TELEPHONE="C"
> LC_MEASUREMENT="C"
> LC_IDENTIFICATION="C"
> LC_ALL=C
> $ LANGUAGE='it_IT:it' LC_ALL='C' apt-listbugs -v
> /usr/lib/ruby/vendor_ruby/aptlistbugs/logic.rb:390:in `width': "\xC3" from
> ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
...
> The failing statements are:
>
> DeprecatedWarning = _("********** on_hold IS DEPRECATED. USE p INSTEAD
> to use pin **********")
> DeprecatedWarningHeader = "*" * Unicode.width(DeprecatedWarning)
>
> If I understand correctly, what seems to happen is that:
>
> • the DeprecatedWarning string is assigned the Italian translation of
> the English message
>
> • the English message is ASCII, while the Italian translation
> includes some non-ASCII UTF-8 characters
>
> • ruby-gettext returns a non-UTF-8 string, since LC_CTYPE is 'C' (?)
It looks like a ruby-gettext error, GNU gettext in such cases returns
original string (because LC_MESSAGES=C), but I should check docs for
gettext.
Reply to: