Re: [gtk-list] Need reference: GdkWChar?



Hello,

In article <Pine.LNX.4.04.9912271847400.28060-100000@archer.kd-dev.com>
dereks@kd-dev.com writes:

>     Hello,
>	I'm trying to learn about character sets.
>
>	I see that a GdkWChar is 4-bytes, and probably represents a "wide
>character".
>
>	But I don't know when someone would use wide characters instead of
>a normal character, or what this has to do with Unicode, or i18n, or any
>of that.

Wide characters are necessary mainly for Asian users. Asian scripts have
more than 256 characters, and char is not sufficient for them. GdkWChar
is the type of wide characters in gdk and gtk+, and is equivalent to
wchar_t in modern environment including glibc2. In order to support old
systems such as Linux libc5, GdkWChar and some wrapper functions/macros
are defined in gdk. gdk_iswalnum(), gdk_iswspace(), gdk_mbstowcs(), and
gdk_wcstombs() are corresponding to iswalnum(), iswsapce(), mbstowcs(),
and wcstombs() in libc. Some _wc valiants of text drawing/measuring
functions are defined in gdkdraw.c and gdkfont.c.

The normal usage of wide characters can be learned by some man pages.
For example, mbstowcs, wcstombs, and XwcDrawString are helpful. Node
"Character Handling" in libc.info is so too.

Please note that the above mention is about gtk+-1.2. The next mejor
release will have more powerful and direct support for Unicode, and
the above functions may become obsolete. Owen is working on the new
i18n in gtk+. See <http://people.redhat.com/otaylor/gscript/> for
details.

--------------------------------------
Akira Higuchi
Dept. of Mathematics, Hokkaido Univ.
Sapporo, Japan
a-higuti@math.sci.hokudai.ac.jp
a@kondara.org



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