On Tue, Mar 23, 2004 at 10:18:06AM +0100, Murray Cumming wrote: > On Tue, 2004-03-23 at 03:37, Paul Elliott wrote: > > I am told that there are some systems where sizeof(wchar_t) == 2. > > On these systems the c locale can only support UCS-2 not UCS-4! > > > > Has Gtkmm or Glibmm been ported to any of these systems? > > I have no idea. I think linux and GTK+ usually use UTF8 rather than UCS2 > or UCS4, and there is a working Windows port. > My understanding is that the buffers in Glib:ustring Gtk::TextBuffer contain UTF8, but the iterators interate over gunichar which are UCS-4. If sizeof(wchar_t) == 2, a wchar_t cannot hold a gunichar. For example ustring.h contains the following: /** Extract a UCS-4 character from UTF-8 data. * Convert a single UTF-8 (multibyte) character starting at @p pos to * a UCS-4 wide character. This may read up to 6 bytes after the start * position, depending on the UTF-8 character width. You have to make * sure the source contains at least one valid UTF-8 character. * * This is mainly used by the implementation of Glib::ustring::iterator, * but it might be useful as utility function if you prefer using * std::string even for UTF-8 encoding. */ gunichar get_unichar_from_std_iterator(std::string::const_iterator pos); -- Paul Elliott 1(512)837-1096 pelliott io com PMB 181, 11900 Metric Blvd Suite J http://www.io.com/~pelliott/pme/ Austin TX 78758-3117
Attachment:
pgpAX2Uofgqja.pgp
Description: PGP signature