Re: setlocale() evil?


I see nobody has replied.  I don't think we should touch this until we
have a clearer explanation of the problems.

Dom Lachowicz didn't elaborate on the issues (other than pointing out
that setlocale() isn't thread-safe, which I think most of us knew

Some applications really do need a way to alter the message catalogs
they use (and formatting conventions for currency, decimal points, etc.)
on-the-fly.  For instance it happens with assistive technologies if for
instance annotations need to be provided to the user in a
locale/language appropriate to the application's locale as opposed to
the default locale of the assistive technology (since assistive
technologies are "meta-apps").  Maybe that's confusing, here's an

screen reader is describing a button, it gets localized UTF-8 from the
application which contains the button's label, and also it gets
information about the label's accelerators.  The screenreader is running
in locale "DE_ch" (or is it CH_de? I forget), the application is running
in "FR_ch" (the speaker is bilingual).  So the screenreader reads the
French label - and the user wants the word "accelerator" to be
translated to FR and not DE.  Other cases frequently turn up - mostly in
the case where different apps are either running in different locales,
or, perhaps more commonly, when applications are incompletely localized
and the bilingual user wants to run them anyhow.

Anyway, setlocale() seems to be the only workable way to accomplish this
today (in conjunction with information about an application's current
locale or LANG setting, which can be gotten from the _WM_ properties). 
It's an important use case for screenreader developers.


- Bill

On Sat, 2003-06-14 at 16:47, Kjartan Maraas wrote:
> Hi.
> I stumbled over this bugreport while looking at gnome-print bugs:
> If setlocale() actually is evil and can wreak havoc with calling
> applications we should probably remove the calls in
> libgnome/libgnome/gnome-i18n.c and
> libgnomeui/libgnomeui/gnome-theme-parser.c too?
> Thoughts?
> Cheers
> Kjartan
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org

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