After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601874 - GLib Unicode Manipulation section clearly says to use g_utf32_to_utf8() / g_utf8_to_utf32() but they don't exist
GLib Unicode Manipulation section clearly says to use g_utf32_to_utf8() / g_u...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
2.22.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-11-14 07:21 UTC by Justin Clift
Modified: 2009-11-15 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggest g_ucs4_to_utf8/g_utf8_to_ucs4 (1.20 KB, patch)
2009-11-15 04:58 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Justin Clift 2009-11-14 07:21:05 UTC
The very start of the "Unicode Manipulation" chapter in the GLib reference library says:

 "gunichar

  A type which can hold any UTF-32 or UCS-4 character code, also known as a Unicode code point.

  To print/scan values of this type to/from text you need to convert to/from UTF-8, using g_utf32_to_utf8()/g_utf8_to_utf32()."

However, neither of the functions g_utf32_to_utf8() nor g_utf8_to_utf32() exist.

Kind of a problem when trying to do processing of UTF-8 characters in my application.

Will hopefully find the correct function names with some Googling, but the docs should probably have this updated so not as to confuse further people.
Comment 1 Javier Jardón (IRC: jjardon) 2009-11-15 04:54:16 UTC
Hello Justin,

You are rigth, you can use g_ucs4_to_utf8/g_utf8_to_ucs4 instead.
Patch attached to fix the documentation problem

Thank you for your bug report
Comment 2 Javier Jardón (IRC: jjardon) 2009-11-15 04:58:02 UTC
Created attachment 147754 [details] [review]
Suggest g_ucs4_to_utf8/g_utf8_to_ucs4
Comment 3 Justin Clift 2009-11-15 16:02:06 UTC
Thanks Javier, and no worries.  Found g_ucs4_to_utf8() last night after some experimentation and have it working the way that's needed. :)
Comment 4 Javier Jardón (IRC: jjardon) 2009-11-15 23:10:07 UTC
Comment on attachment 147754 [details] [review]
Suggest g_ucs4_to_utf8/g_utf8_to_ucs4

commit 18b3ff33afad10dfac7dfdf3025313490f8313cc
Comment 5 Javier Jardón (IRC: jjardon) 2009-11-15 23:10:21 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.