Re: gdk_set_locale




informer@mylinux.cgu.edu.tw writes:

> When I reading the gdk_set_locale in
> 
> http://cvs.gnome.org/lxr/source/gtk%2b/gdk/gdkim.c#100
> 
> it seemed that it did not pass LANG enviroment
> variable to setlocale()
> 
> it is me to mis-understand the code or ... ?

You don't need to pass the LANG environment variable to setlocale() - 
if the second parameter to setlocale() is "", then it will look
at the environment variables, LC_ALL, LC_CTYPE, ..., and LANG.
 
> BTW, many programmers did not use gtk_set_locale(), and sometimes
> they used gtk_set_locale() after gtk_init()

GNOME automatically does gtk_set_locale(), but you are probably
right that most pure GTK+ programs omit to do so.
 
> And they always forgot to use gdk_fontset_load()...
> 
> Could we provide a new function call 

The Pango font APIs, which will eventually replace gdk_fontset_load()
will be designed so that the programmer doesn't have to do
anything special to get correct handling of international characters -

If the font specified does not contain all the characters in the
string, then fallbacks will automatically be provided, and there
will also be standard aliases such as "sans", "serif", "fixed", that
can be customized by the vendor, system administrator and user.

> or write a FAQ ?

If somebody wants to write an entry on "How do I make my program
suitable for international use?" for the GTK+ FAQ, that would be
appreciated.

Regards,
                                        Owen



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