On 6 February 2010 15:23, Patric Mueller <[email protected]> wrote:
> Michal Suchanek <[email protected]> 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.

It also works if you specify the locale as argument to -L.

So to use vilistextum in some odd build environment which runs in "C"
locale but wants utf-8 output just specify an utf-8 locale as argument
(and possibly build-depend on locales-all).

>
>
> 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.

This is something I wanted to avoid because it requires parsing
setlocale -a in the program and does not guarantee that a working
locale is found.

Still it should work in the common case either way.

Thanks

Michal



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to