This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
GdkWChar (was: Added a bunch of GDK routines.)
- From: Kevin Ryde <user42 at zip dot com dot au>
- To: guile-gtk at sources dot redhat dot com
- Date: Sat, 07 Jun 2003 08:22:46 +1000
- Subject: GdkWChar (was: Added a bunch of GDK routines.)
- References: <m33cjyxi3p.fsf@lumo.pacujo.net>
Marko Rauhamaa <marko@pacujo.net> writes:
>
> - gdk-1.2.defs: Defined an alias GdkWChar for uint for
> gdk_draw_text_wc. (I trust uint to correspond to guint32 because
> currently there is no alternative.)
Presumably one day guile will get its own notion of chars bigger than
a byte. Probably no alternative to plain integers until then. I'm
thinking the words below can cover the present situation at least.
[General conventions:]
Strings
Gtk generally uses strings encoded in UTF-8. Guile (version 1.6)
has no direct notion of multi-byte characters in strings, so
applications will need to take care when in a non-ASCII or
non-Latin locale.
Converting to `GdkWChar' with `gdk-mbstowc' (*note Gdk Module::) is
one way to identify character boundaries at least.
[Gdk Module:]
`GdkWChar'
Currently `GdkWChar' values are represented as integers, and
`GdkWChar' strings as vectors of integers. So for instance
`gdk-mbstowc' returns such a vector (or `#f' if conversion fails).
Note that this representation might change in the future if Guile
gets its own notion of characters bigger than 8 bits.