GNOME Bugzilla – Bug 740818
gunichar2 not bound
Last modified: 2016-10-03 19:37:42 UTC
gunichar has bindings in glib-2.0.vapi, but gunichar2 does not.
Created attachment 335799 [details] [review] glib-2.0: Add UCS-4 and UTF-16 related bindings
@chpe: It this what you would expect to be able to work with.
Hmm. IIRC I filed this when I was working on bindings for PCRE's 16- and 32-bit libraries, so what I had in mind would have been full string16/string32 classes for utf-16/32 like string for utf-8. Since glib doesn't have all the functions for these like for 8-bit strings, I guess only providing the basics and the to/from utf16/32 conversion functions is ok for now. (However I'd name the API utf32 not ucs4, even though the glib functions have ucs4 in the name.)
Created attachment 336212 [details] [review] glib-2.0: Add UCS-4 and UTF-16 related bindings
The name unistring is misleading, in my opinion, as the string type is a Unicode string as well. Does anything speak against string16/string32? I would also not use ucs4 as name anywhere. As far as I know, the relevance of UCS-4 is only historical and the (permanently unassigned) code points that are not in UTF-32 are not representable in UTF-8 or UTF-16 either.
I guess I am fine with string16 and string32 while keeping the current method names.
Created attachment 336380 [details] [review] glib-2.0: Add UCS-4 and UTF-16 related bindings
(In reply to Jürg Billeter from comment #5) > The name unistring is misleading, in my opinion, as the string type is a > Unicode string as well. Does anything speak against string16/string32? string16/string32 sound fine to me. > I would also not use ucs4 as name anywhere. As far as I know, the relevance of > UCS-4 is only historical and the (permanently unassigned) code points that > are not in UTF-32 are not representable in UTF-8 or UTF-16 either. Note that not all of the glib functions do support these codepoints, i.e. g_utf8_to_ucs4_fast() does not (anymore, see bug 738504 comment 10), and the others probably aren't guaranteed to, either. So using utf32 in the names would really be better.
Created attachment 336382 [details] [review] glib-2.0: Add UCS-4 and UTF-16 related bindings
Attachment 336382 [details] pushed as 5c5245d - glib-2.0: Add UCS-4 and UTF-16 related bindings