2010/2/7 Patric Mueller <bh...@gmx.net>:
> Michal Suchanek <hramr...@centrum.cz> wrote:
>> On 6 February 2010 15:23, Patric Mueller <bh...@gmx.net> wrote:
>>> Michal Suchanek <hramr...@centrum.cz> wrote:
>>>> FWIW here is a patch that
>>>>
>>>> a) tries to detect if user is running in utf-8 locale by a heuristic
>>>> similar that that used in the autoconf test
>>>
>>> setlocale(LC_CTYPE, "") only sets the current LC_CTYPE to the value of
>>> the user environment.
>>>
>>> If e.g. the user has LC_ALL=C the program will fail even if there is a
>>> utf-8 locale it could use installed on the computer.
>>
>> Yes, and it's expected that users that want utf-8 output do have utf-8
>> locale set so it just works in most cases.
>
> But the utf-8 locale isn't only used for utf-8 output. As utf-8 is
> used as internal standard encoding it is also used when e.g.
> converting a latin1 or a shift_jis html file.
>
> Requiring that the user has set an utf-8 locale for those cases is
> unnecessary.

Yes, you are right that the utf-8 locale is used in some odd way
during the conversion.

>>> The attached patch first tries to set the locale found in the autoconf
>>> script.
>>>
>>> If that fails, it popens 'locale -a' and searches for a working utf-8
>>> locale to use.
>
>> Still it should work in the common case either way.
>
> I'm not sure that the not so common cases you're thinking of are that
> rare. For example, my OS is completely utf-8 capable, but I prefer my
> shell to be in latin1.

That's certainly unusual, especially given that latin-1 should work in
utf-8 without additional conversion.

>
> Nevertheless, IMO the finding-the-locale-at-runtime approach has a
> bigger chance of just working in more cases with less user
> intervention.
>

Yes, that's what I would like to see happening. This is less of a
problem in Gentoo because every user builds their own packages but in
Debian the detection of utf-8 locale has to be done at runtime.

Thanks

Michal



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to