gdki18n.h




I've been working some more on i18n configuration issues. Some
changes are necessary, but there are a lot of different ways
of doing things, so I'd appreciate some comments on the following.

Background
----------

gdk18n.h is meant to provide a consistent interface to manipulation of
wide and multi-byte strings. If during, configuration, 'configure'
determines that your OS has insufficient support for the locale you
want to use, X's built locale support will be used (X_LOCALE is
defined), otherwise, the OS support will be used. 

In the normal course of things, this type of non-GUI stuff should
belong in libglib, but that would make glib depend on the X libraries,
(When X_LOCALE is enabled) ... which might be considered undesirable.

To do this correctly, gdki18n.h needs to have information from
configuration. This is easy while GDK is being compiled, but since
gdk18n.h is included by gdk.h, this information also needs to be
present after installation.  A configuration file gdk/gdkconfig.h
could be created easily enough, or, alternatively, gdki18n.h could
simply not be installed (and hence not included in gdk.h.)  It may be
better (and easier) for other programs to deal with their i18n needs
separately.

Also, currently the functions simply use their POSIX/Unix names. 

(I.e., when X_LOCALE is in effect, the code does:

#define mbstowcs(a,b,c)	_Xmbstowcs ((a),(b),(c)))
)

It might be better to define GDK specific functions g_mbstowcs, etc.
(Or gdk_mbtowcs if the functions stay in GDK.) This would prevent
conflicts with application programs. (cf, g_strdup, g_malloc, ...)

Questions:
----------

Is it OK for glib to depend on the X libraries?

If so, should this stuff be moved to glib?

Should gdki18n.h be installed? Should it be automatically included?

Should the functions be renamed to g_* ?

Thanks,
                                        Owen






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