This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: coding neutral regexec to do UTF-8 ranges
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: jkraehemann-guest at users dot alioth dot debian dot org
- Cc: libc-help at sourceware dot org
- Date: Sat, 24 Jun 2017 20:51:48 +0200
- Subject: Re: coding neutral regexec to do UTF-8 ranges
- Authentication-results: sourceware.org; auth=none
- References: <CA+Owze7Qh_+fWgk1vX2Y7p2Me+mQmMhp+j-NjCswAQ8Wq=yipQ@mail.gmail.com> <b0a3c147-6ab0-8438-b456-d443409e3179@redhat.com> <CA+Owze72SvW7fAS+rSOUgf7WBAy77Ok=d9BoXqU2jvm+tuJeHQ@mail.gmail.com>
* Joël Krähemann:
> You just ignored the main issue. Getting gettext to work.
>
> I assume uselocale() does almost the same as putenv() passing
> the environment variable. This is what I actually do.
It's subtly different: uselocale only affects the current thread.
> putenv("LANG=C");
> putenv("LC_ALL=C");
>
> However gettext requires UTF-8 locales, afaik. I need a solution that
> works for every thread that might call ags_turtle.c related functions.
You need to set and restore the thread locale around the regular
expression function calls (for both compilation and execution).