glib-Unicode-Manipulation.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Unicode Manipulation</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-utilities.html" title="GLib Utilities"><link rel="previous" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="next" href="glib-I18N.html" title="Internationalization"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="refentry" href="glib-building.html" title="Compiling the GLib package"><link rel="refentry" href="glib-cross-compiling.html" title="Cross-compiling the GLib package"><link rel="refentry" href="glib-compiling.html" title="Compiling GLib Applications"><link rel="refentry" href="glib-running.html" title="Running GLib Applications"><link rel="refentry" href="glib-changes.html" title="Changes to GLib"><link rel="refentry" href="glib-resources.html" title="Mailing lists and bug reports"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="refentry" href="glib-Basic-Types.html" title="Basic Types"><link rel="refentry" href="glib-Limits-of-Basic-Types.html" title="Limits of Basic Types"><link rel="refentry" href="glib-Standard-Macros.html" title="Standard Macros"><link rel="refentry" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros"><link rel="refentry" href="glib-Byte-Order-Macros.html" title="Byte Order Macros"><link rel="refentry" href="glib-Numerical-Definitions.html" title="Numerical Definitions"><link rel="refentry" href="glib-Miscellaneous-Macros.html" title="Miscellaneous Macros"><link rel="refentry" href="glib-Atomic-Operations.html" title="Atomic Operations"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="refentry" href="glib-The-Main-Event-Loop.html" title="The Main Event Loop"><link rel="refentry" href="glib-Threads.html" title="
Threads"><link rel="refentry" href="glib-Thread-Pools.html" title="Thread Pools"><link rel="refentry" href="glib-Asynchronous-Queues.html" title="Asynchronous Queues"><link rel="refentry" href="glib-Dynamic-Loading-of-Modules.html" title="Dynamic Loading of Modules"><link rel="refentry" href="glib-Memory-Allocation.html" title="Memory Allocation"><link rel="refentry" href="glib-IO-Channels.html" title="IO Channels"><link rel="refentry" href="glib-Error-Reporting.html" title="Error Reporting"><link rel="refentry" href="glib-Warnings-and-Assertions.html" title="Message Output and Debugging Functions"><link rel="refentry" href="glib-Message-Logging.html" title="Message Logging"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="refentry" href="glib-String-Utility-Functions.html" title="String Utility Functions"><link rel="refentry" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="refentry" href="glib-Unicode-Manipulation.html" title="Unicode Manipulation"><link rel="refentry" href="glib-I18N.html" title="Internationalization"><link rel="refentry" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions"><link rel="refentry" href="glib-Random-Numbers.html" title="Random Numbers"><link rel="refentry" href="glib-Hook-Functions.html" title="Hook Functions"><link rel="refentry" href="glib-Miscellaneous-Utility-Functions.html" title="Miscellaneous Utility Functions"><link rel="refentry" href="glib-Lexical-Scanner.html" title="Lexical Scanner"><link rel="refentry" href="glib-Automatic-String-Completion.html" title="Automatic String Completion"><link rel="refentry" href="glib-Timers.html" title="Timers"><link rel="refentry" href="glib-Spawning-Processes.html" title="Spawning Processes"><link rel="refentry" href="glib-File-Utilities.html" title="File Utilities"><link rel="refentry" href="glib-Shell-related-Utilities.html" title="Shell-related Utilities"><link rel="refentry" href="glib-Glob-style-pattern-matching.html" title="Glob-style pattern matching"><link rel="refentry" href="glib-Simple-XML-Subset-Parser.html" title="Simple XML Subset Parser"><link rel="refentry" href="glib-Windows-Compatability-Functions.html" title="Windows Compatibility Functions"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="refentry" href="glib-Memory-Chunks.html" title="Memory Chunks"><link rel="refentry" href="glib-Doubly-Linked-Lists.html" title="Doubly-Linked Lists"><link rel="refentry" href="glib-Singly-Linked-Lists.html" title="Singly-Linked Lists"><link rel="refentry" href="glib-Double-ended-Queues.html" title="Double-ended Queues"><link rel="refentry" href="glib-Trash-Stacks.html" title="Trash Stacks"><link rel="refentry" href="glib-Hash-Tables.html" title="Hash Tables"><link rel="refentry" href="glib-Strings.html" title="Strings"><link rel="refentry" href="glib-String-Chunks.html" title="String Chunks"><link rel="refentry" href="glib-Arrays.html" title="Arrays"><link rel="refentry" href="glib-Pointer-Arrays.html" title="Pointer Arrays"><link rel="refentry" href="glib-Byte-Arrays.html" title="Byte Arrays"><link rel="refentry" href="glib-Balanced-Binary-Trees.html" title="Balanced Binary Trees"><link rel="refentry" href="glib-N-ary-Trees.html" title="N-ary Trees"><link rel="refentry" href="glib-Quarks.html" title="Quarks"><link rel="refentry" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists"><link rel="refentry" href="glib-Datasets.html" title="Datasets"><link rel="refentry" href="glib-Relations-and-Tuples.html" title="Relations and Tuples"><link rel="refentry" href="glib-Caches.html" title="Caches"><link rel="refentry" href="glib-Memory-Allocators.html" title="Memory Allocators"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="refentry" href="glib-gettextize.html" title="glib-gettextize"><link rel="index" href="ix01.html" title="Index"><link rel="section" href="glib-Unicode-Manipulation.html#id3130482" title="Description"><link rel="section" href="glib-Unicode-Manipulation.html#id3130505" title="Details"><link rel="section" href="glib-Unicode-Manipulation.html#id3137677" title="See Also"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-Character-Set-Conversion.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GLib Reference Manual</th><td><a accesskey="n" href="glib-I18N.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="glib-Unicode-Manipulation"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Unicode Manipulation</span></h2><p>Unicode Manipulation &#8212; functions operating on Unicode characters and UTF-8 strings.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">

#include &lt;glib.h&gt;


typedef     <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>;
typedef     <a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a>;

<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-validate">g_unichar_validate</a>              (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isalnum">g_unichar_isalnum</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isalpha">g_unichar_isalpha</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-iscntrl">g_unichar_iscntrl</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isdigit">g_unichar_isdigit</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isgraph">g_unichar_isgraph</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-islower">g_unichar_islower</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isprint">g_unichar_isprint</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-ispunct">g_unichar_ispunct</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isspace">g_unichar_isspace</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isupper">g_unichar_isupper</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isxdigit">g_unichar_isxdigit</a>              (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-istitle">g_unichar_istitle</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-isdefined">g_unichar_isdefined</a>             (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-iswide">g_unichar_iswide</a>                (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-toupper">g_unichar_toupper</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-tolower">g_unichar_tolower</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-totitle">g_unichar_totitle</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Unicode-Manipulation.html#g-unichar-digit-value">g_unichar_digit_value</a>           (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Unicode-Manipulation.html#g-unichar-xdigit-value">g_unichar_xdigit_value</a>          (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
enum        <a href="glib-Unicode-Manipulation.html#GUnicodeType">GUnicodeType</a>;
<a href="glib-Unicode-Manipulation.html#GUnicodeType">GUnicodeType</a> <a href="glib-Unicode-Manipulation.html#g-unichar-type">g_unichar_type</a>                 (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
enum        <a href="glib-Unicode-Manipulation.html#GUnicodeBreakType">GUnicodeBreakType</a>;
<a href="glib-Unicode-Manipulation.html#GUnicodeBreakType">GUnicodeBreakType</a> <a href="glib-Unicode-Manipulation.html#g-unichar-break-type">g_unichar_break_type</a>      (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
void        <a href="glib-Unicode-Manipulation.html#g-unicode-canonical-ordering">g_unicode_canonical_ordering</a>    (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *string,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> len);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   <a href="glib-Unicode-Manipulation.html#g-unicode-canonical-decomposition">g_unicode_canonical_decomposition</a>
                                            (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> *result_len);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-unichar-get-mirror-char">g_unichar_get_mirror_char</a>       (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *mirrored_ch);

#define     <a href="glib-Unicode-Manipulation.html#g-utf8-next-char">g_utf8_next_char</a>                (p)
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    <a href="glib-Unicode-Manipulation.html#g-utf8-get-char">g_utf8_get_char</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    <a href="glib-Unicode-Manipulation.html#g-utf8-get-char-validated">g_utf8_get_char_validated</a>       (const  <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max_len);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-offset-to-pointer">g_utf8_offset_to_pointer</a>        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> offset);
<a href="glib-Basic-Types.html#glong">glong</a>       <a href="glib-Unicode-Manipulation.html#g-utf8-pointer-to-offset">g_utf8_pointer_to_offset</a>        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *pos);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-prev-char">g_utf8_prev_char</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-find-next-char">g_utf8_find_next_char</a>           (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *end);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-find-prev-char">g_utf8_find_prev_char</a>           (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);
<a href="glib-Basic-Types.html#glong">glong</a>       <a href="glib-Unicode-Manipulation.html#g-utf8-strlen">g_utf8_strlen</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strncpy">g_utf8_strncpy</a>                  (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strchr">g_utf8_strchr</a>                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strrchr">g_utf8_strrchr</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strreverse">g_utf8_strreverse</a>               (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);
<a href="glib-Basic-Types.html#gboolean">gboolean</a>    <a href="glib-Unicode-Manipulation.html#g-utf8-validate">g_utf8_validate</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> **end);

<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strup">g_utf8_strup</a>                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-strdown">g_utf8_strdown</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-casefold">g_utf8_casefold</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-normalize">g_utf8_normalize</a>                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#GNormalizeMode">GNormalizeMode</a> mode);
enum        <a href="glib-Unicode-Manipulation.html#GNormalizeMode">GNormalizeMode</a>;
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Unicode-Manipulation.html#g-utf8-collate">g_utf8_collate</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *str2);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf8-collate-key">g_utf8_collate_key</a>              (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);

<a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a>*  <a href="glib-Unicode-Manipulation.html#g-utf8-to-utf16">g_utf8_to_utf16</a>                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   <a href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4">g_utf8_to_ucs4</a>                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   <a href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4-fast">g_utf8_to_ucs4_fast</a>             (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written);
<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   <a href="glib-Unicode-Manipulation.html#g-utf16-to-ucs4">g_utf16_to_ucs4</a>                 (const <a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-utf16-to-utf8">g_utf16_to_utf8</a>                 (const <a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a>*  <a href="glib-Unicode-Manipulation.html#g-ucs4-to-utf16">g_ucs4_to_utf16</a>                 (const <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Basic-Types.html#gchar">gchar</a>*      <a href="glib-Unicode-Manipulation.html#g-ucs4-to-utf8">g_ucs4_to_utf8</a>                  (const <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);
<a href="glib-Basic-Types.html#gint">gint</a>        <a href="glib-Unicode-Manipulation.html#g-unichar-to-utf8">g_unichar_to_utf8</a>               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> *outbuf);
</pre></div><div class="refsect1" lang="en"><a name="id3130482"></a><h2>Description</h2><p>
This section describes a number of functions for dealing with
Unicode characters and strings.  There are analogues of the
traditional <tt class="filename">ctype.h</tt> character classification
and case conversion functions, UTF-8 analogues of some string utility 
functions, functions to perform normalization, case conversion and
collation on UTF-8 strings and finally functions to convert between
the UTF-8, UTF-16 and UCS-4 encodings of Unicode.
</p></div><div class="refsect1" lang="en"><a name="id3130505"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3130511"></a><h3><a name="gunichar"></a>gunichar</h3><a class="indexterm" name="id3130521"></a><pre class="programlisting">typedef guint32 gunichar;
</pre><p>
A type which can hold any UCS-4 character code. 
</p></div><hr><div class="refsect2" lang="en"><a name="id3130537"></a><h3><a name="gunichar2"></a>gunichar2</h3><a class="indexterm" name="id3130547"></a><pre class="programlisting">typedef guint16 gunichar2;
</pre><p>
A type which can hold any UTF-16 character code. 
</p></div><hr><div class="refsect2" lang="en"><a name="id3130563"></a><h3><a name="g-unichar-validate"></a>g_unichar_validate ()</h3><a class="indexterm" name="id3130575"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_validate              (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch);</pre><p>
Checks whether <i class="parameter"><tt>ch</tt></i> is a valid Unicode character. Some possible
integer values of <i class="parameter"><tt>ch</tt></i> will not be valid. 0 is considered a valid
character, though it's normally a string terminator.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ch</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>ch</tt></i> is a valid Unicode character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3130660"></a><h3><a name="g-unichar-isalnum"></a>g_unichar_isalnum ()</h3><a class="indexterm" name="id3130672"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isalnum               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is alphanumeric.
Given some UTF-8 text, obtain a character value
with <a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an alphanumeric character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3130755"></a><h3><a name="g-unichar-isalpha"></a>g_unichar_isalpha ()</h3><a class="indexterm" name="id3130767"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isalpha               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is alphabetic (i.e. a letter).
Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an alphabetic character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3130850"></a><h3><a name="g-unichar-iscntrl"></a>g_unichar_iscntrl ()</h3><a class="indexterm" name="id3130862"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_iscntrl               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is a control character.
Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is a control character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3130945"></a><h3><a name="g-unichar-isdigit"></a>g_unichar_isdigit ()</h3><a class="indexterm" name="id3130956"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isdigit               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is numeric (i.e. a digit).  This
covers ASCII 0-9 and also digits in other languages/scripts.  Given
some UTF-8 text, obtain a character value with <a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is a digit
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131041"></a><h3><a name="g-unichar-isgraph"></a>g_unichar_isgraph ()</h3><a class="indexterm" name="id3131052"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isgraph               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is printable and not a space
(returns <tt class="literal">FALSE</tt> for control characters, format characters, and
spaces). <a href="glib-Unicode-Manipulation.html#g-unichar-isprint"><tt class="function">g_unichar_isprint()</tt></a> is similar, but returns <tt class="literal">TRUE</tt> for
spaces. Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is printable unless it's a space
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131160"></a><h3><a name="g-unichar-islower"></a>g_unichar_islower ()</h3><a class="indexterm" name="id3131171"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_islower               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is a lowercase letter.
Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is a lowercase letter
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131254"></a><h3><a name="g-unichar-isprint"></a>g_unichar_isprint ()</h3><a class="indexterm" name="id3131266"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isprint               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is printable.
Unlike <a href="glib-Unicode-Manipulation.html#g-unichar-isgraph"><tt class="function">g_unichar_isgraph()</tt></a>, returns <tt class="literal">TRUE</tt> for spaces.
Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is printable
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131366"></a><h3><a name="g-unichar-ispunct"></a>g_unichar_ispunct ()</h3><a class="indexterm" name="id3131377"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_ispunct               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is punctuation or a symbol.
Given some UTF-8 text, obtain a character value with
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is a punctuation or symbol character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131461"></a><h3><a name="g-unichar-isspace"></a>g_unichar_isspace ()</h3><a class="indexterm" name="id3131472"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isspace               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines whether a character is a space, tab, or line separator
(newline, carriage return, etc.).  Given some UTF-8 text, obtain a
character value with <a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>.
</p><p>
(Note: don't use this to do word breaking; you have to use
Pango or equivalent to get word breaking right, the algorithm
is fairly complex.)</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is a punctuation character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131562"></a><h3><a name="g-unichar-isupper"></a>g_unichar_isupper ()</h3><a class="indexterm" name="id3131573"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isupper               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines if a character is uppercase.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>c</tt></i> is an uppercase character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131645"></a><h3><a name="g-unichar-isxdigit"></a>g_unichar_isxdigit ()</h3><a class="indexterm" name="id3131656"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isxdigit              (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines if a character is a hexidecimal digit.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the character is a hexadecimal digit
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131723"></a><h3><a name="g-unichar-istitle"></a>g_unichar_istitle ()</h3><a class="indexterm" name="id3131734"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_istitle               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines if a character is titlecase. Some characters in
Unicode which are composites, such as the DZ digraph
have three case variants instead of just two. The titlecase
form is used at the beginning of a word where only the
first letter is capitalized. The titlecase form of the DZ
digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the character is titlecase
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131806"></a><h3><a name="g-unichar-isdefined"></a>g_unichar_isdefined ()</h3><a class="indexterm" name="id3131817"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_isdefined             (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines if a given character is assigned in the Unicode
standard.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the character has an assigned value
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131884"></a><h3><a name="g-unichar-iswide"></a>g_unichar_iswide ()</h3><a class="indexterm" name="id3131895"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_iswide                (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines if a character is typically rendered in a double-width
cell.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the character is wide
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3131962"></a><h3><a name="g-unichar-toupper"></a>g_unichar_toupper ()</h3><a class="indexterm" name="id3131973"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    g_unichar_toupper               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Converts a character to uppercase.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the result of converting <i class="parameter"><tt>c</tt></i> to uppercase.
              If <i class="parameter"><tt>c</tt></i> is not an lowercase or titlecase character,
              or has no upper case equivalent <i class="parameter"><tt>c</tt></i> is returned unchanged.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132053"></a><h3><a name="g-unichar-tolower"></a>g_unichar_tolower ()</h3><a class="indexterm" name="id3132064"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    g_unichar_tolower               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Converts a character to lower case.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the result of converting <i class="parameter"><tt>c</tt></i> to lower case.
              If <i class="parameter"><tt>c</tt></i> is not an upperlower or titlecase character,
              or has no lowercase equivalent <i class="parameter"><tt>c</tt></i> is returned unchanged.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132144"></a><h3><a name="g-unichar-totitle"></a>g_unichar_totitle ()</h3><a class="indexterm" name="id3132155"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    g_unichar_totitle               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Converts a character to the titlecase.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the result of converting <i class="parameter"><tt>c</tt></i> to titlecase.
              If <i class="parameter"><tt>c</tt></i> is not an uppercase or lowercase character,
              <i class="parameter"><tt>c</tt></i> is returned unchanged.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132234"></a><h3><a name="g-unichar-digit-value"></a>g_unichar_digit_value ()</h3><a class="indexterm" name="id3132246"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_unichar_digit_value           (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines the numeric value of a character as a decimal
digit.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> If <i class="parameter"><tt>c</tt></i> is a decimal digit (according to
<a href="glib-Unicode-Manipulation.html#g-unichar-isdigit"><tt class="function">g_unichar_isdigit()</tt></a>), its numeric value. Otherwise, -1.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132324"></a><h3><a name="g-unichar-xdigit-value"></a>g_unichar_xdigit_value ()</h3><a class="indexterm" name="id3132335"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_unichar_xdigit_value          (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines the numeric value of a character as a hexidecimal
digit.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> If <i class="parameter"><tt>c</tt></i> is a hex digit (according to
<a href="glib-Unicode-Manipulation.html#g-unichar-isxdigit"><tt class="function">g_unichar_isxdigit()</tt></a>), its numeric value. Otherwise, -1.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132414"></a><h3><a name="GUnicodeType"></a>enum GUnicodeType</h3><a class="indexterm" name="id3132425"></a><pre class="programlisting">typedef enum
{
  G_UNICODE_CONTROL,
  G_UNICODE_FORMAT,
  G_UNICODE_UNASSIGNED,
  G_UNICODE_PRIVATE_USE,
  G_UNICODE_SURROGATE,
  G_UNICODE_LOWERCASE_LETTER,
  G_UNICODE_MODIFIER_LETTER,
  G_UNICODE_OTHER_LETTER,
  G_UNICODE_TITLECASE_LETTER,
  G_UNICODE_UPPERCASE_LETTER,
  G_UNICODE_COMBINING_MARK,
  G_UNICODE_ENCLOSING_MARK,
  G_UNICODE_NON_SPACING_MARK,
  G_UNICODE_DECIMAL_NUMBER,
  G_UNICODE_LETTER_NUMBER,
  G_UNICODE_OTHER_NUMBER,
  G_UNICODE_CONNECT_PUNCTUATION,
  G_UNICODE_DASH_PUNCTUATION,
  G_UNICODE_CLOSE_PUNCTUATION,
  G_UNICODE_FINAL_PUNCTUATION,
  G_UNICODE_INITIAL_PUNCTUATION,
  G_UNICODE_OTHER_PUNCTUATION,
  G_UNICODE_OPEN_PUNCTUATION,
  G_UNICODE_CURRENCY_SYMBOL,
  G_UNICODE_MODIFIER_SYMBOL,
  G_UNICODE_MATH_SYMBOL,
  G_UNICODE_OTHER_SYMBOL,
  G_UNICODE_LINE_SEPARATOR,
  G_UNICODE_PARAGRAPH_SEPARATOR,
  G_UNICODE_SPACE_SEPARATOR
} GUnicodeType;
</pre><p>
These are the possible character classifications.
See <a href="http://www.unicode.org/Public/UNIDATA/UnicodeData.html" target="_top">http://www.unicode.org/Public/UNIDATA/UnicodeData.html</a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id3132462"></a><h3><a name="g-unichar-type"></a>g_unichar_type ()</h3><a class="indexterm" name="id3132473"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#GUnicodeType">GUnicodeType</a> g_unichar_type                 (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Classifies a Unicode character by type.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the type of the character.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132534"></a><h3><a name="GUnicodeBreakType"></a>enum GUnicodeBreakType</h3><a class="indexterm" name="id3132546"></a><pre class="programlisting">typedef enum
{
  G_UNICODE_BREAK_MANDATORY,
  G_UNICODE_BREAK_CARRIAGE_RETURN,
  G_UNICODE_BREAK_LINE_FEED,
  G_UNICODE_BREAK_COMBINING_MARK,
  G_UNICODE_BREAK_SURROGATE,
  G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
  G_UNICODE_BREAK_INSEPARABLE,
  G_UNICODE_BREAK_NON_BREAKING_GLUE,
  G_UNICODE_BREAK_CONTINGENT,
  G_UNICODE_BREAK_SPACE,
  G_UNICODE_BREAK_AFTER,
  G_UNICODE_BREAK_BEFORE,
  G_UNICODE_BREAK_BEFORE_AND_AFTER,
  G_UNICODE_BREAK_HYPHEN,
  G_UNICODE_BREAK_NON_STARTER,
  G_UNICODE_BREAK_OPEN_PUNCTUATION,
  G_UNICODE_BREAK_CLOSE_PUNCTUATION,
  G_UNICODE_BREAK_QUOTATION,
  G_UNICODE_BREAK_EXCLAMATION,
  G_UNICODE_BREAK_IDEOGRAPHIC,
  G_UNICODE_BREAK_NUMERIC,
  G_UNICODE_BREAK_INFIX_SEPARATOR,
  G_UNICODE_BREAK_SYMBOL,
  G_UNICODE_BREAK_ALPHABETIC,
  G_UNICODE_BREAK_PREFIX,
  G_UNICODE_BREAK_POSTFIX,
  G_UNICODE_BREAK_COMPLEX_CONTEXT,
  G_UNICODE_BREAK_AMBIGUOUS,
  G_UNICODE_BREAK_UNKNOWN,
  G_UNICODE_BREAK_NEXT_LINE,
  G_UNICODE_BREAK_WORD_JOINER
} GUnicodeBreakType;
</pre><p>
These are the possible line break classifications.
See <a href="http://www.unicode.org/unicode/reports/tr14/" target="_top">http://www.unicode.org/unicode/reports/tr14/</a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id3132601"></a><h3><a name="g-unichar-break-type"></a>g_unichar_break_type ()</h3><a class="indexterm" name="id3132612"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#GUnicodeBreakType">GUnicodeBreakType</a> g_unichar_break_type      (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Determines the break type of <i class="parameter"><tt>c</tt></i>. <i class="parameter"><tt>c</tt></i> should be a Unicode character
(to derive a character from UTF-8 encoded text, use
<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><tt class="function">g_utf8_get_char()</tt></a>). The break type is used to find word and line
breaks ("text boundaries"), Pango implements the Unicode boundary
resolution algorithms and normally you would use a function such
as <tt class="function">pango_break()</tt> instead of caring about break types yourself.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a Unicode character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the break type of <i class="parameter"><tt>c</tt></i>
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132717"></a><h3><a name="g-unicode-canonical-ordering"></a>g_unicode_canonical_ordering ()</h3><a class="indexterm" name="id3132729"></a><pre class="programlisting">void        g_unicode_canonical_ordering    (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *string,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> len);</pre><p>
Computes the canonical ordering of a string in-place.  
This rearranges decomposed characters in the string 
according to their combining classes.  See the Unicode 
manual for more information.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> a UCS-4 encoded string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>string</tt></i> to use.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132810"></a><h3><a name="g-unicode-canonical-decomposition"></a>g_unicode_canonical_decomposition ()</h3><a class="indexterm" name="id3132822"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   g_unicode_canonical_decomposition
                                            (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> *result_len);</pre><p>
Computes the canonical decomposition of a Unicode character.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ch</tt></i> :</span></td><td> a Unicode character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>result_len</tt></i> :</span></td><td> location to store the length of the return value.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string of Unicode characters.
  <i class="parameter"><tt>result_len</tt></i> is set to the resulting length of the string.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3132912"></a><h3><a name="g-unichar-get-mirror-char"></a>g_unichar_get_mirror_char ()</h3><a class="indexterm" name="id3132925"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_unichar_get_mirror_char       (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *mirrored_ch);</pre><p>
In Unicode, some characters are <i class="firstterm">mirrored</i>. This
means that their images are mirrored horizontally in text that is laid
out from right to left. For instance, "(" would become its mirror image,
")", in right-to-left text.
</p><p>
If <i class="parameter"><tt>ch</tt></i> has the Unicode mirrored property and there is another unicode
character that typically has a glyph that is the mirror image of <i class="parameter"><tt>ch</tt></i>'s
glyph, puts that character in the address pointed to by <i class="parameter"><tt>mirrored_ch</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ch</tt></i> :</span></td><td> a unicode character
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mirrored_ch</tt></i> :</span></td><td> location to store the mirrored character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if <i class="parameter"><tt>ch</tt></i> has a mirrored character and <i class="parameter"><tt>mirrored_ch</tt></i> is
filled in, <tt class="literal">FALSE</tt> otherwise

</td></tr></tbody></table></div><p>Since  2.4
</p></div><hr><div class="refsect2" lang="en"><a name="id3133065"></a><h3><a name="g-utf8-next-char"></a>g_utf8_next_char()</h3><a class="indexterm" name="id3133076"></a><pre class="programlisting">#define     g_utf8_next_char(p)</pre><p>
Skips to the next character in a UTF-8 string. The string must be
valid; this macro is as fast as possible, and has no error-checking.
You would use this macro to iterate over a string character by
character. The macro returns the start of the next UTF-8 character.
Before using this macro, use <a href="glib-Unicode-Manipulation.html#g-utf8-validate"><tt class="function">g_utf8_validate()</tt></a> to validate strings
that may contain invalid UTF-8.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td>Pointer to the start of a valid UTF-8 character.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133126"></a><h3><a name="g-utf8-get-char"></a>g_utf8_get_char ()</h3><a class="indexterm" name="id3133138"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    g_utf8_get_char                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);</pre><p>
Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
If <i class="parameter"><tt>p</tt></i> does not point to a valid UTF-8 encoded character, results are
undefined. If you are not sure that the bytes are complete
valid Unicode characters, you should use <a href="glib-Unicode-Manipulation.html#g-utf8-get-char-validated"><tt class="function">g_utf8_get_char_validated()</tt></a>
instead.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a pointer to Unicode character encoded as UTF-8
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the resulting character
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133218"></a><h3><a name="g-utf8-get-char-validated"></a>g_utf8_get_char_validated ()</h3><a class="indexterm" name="id3133231"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>    g_utf8_get_char_validated       (const  <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max_len);</pre><p>
Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
This function checks for incomplete characters, for invalid characters
such as characters that are out of the range of Unicode, and for
overlong encodings of valid characters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a pointer to Unicode character encoded as UTF-8
</td></tr><tr><td><span class="term"><i class="parameter"><tt>max_len</tt></i> :</span></td><td> the maximum number of bytes to read, or -1, for no maximum.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the resulting character. If <i class="parameter"><tt>p</tt></i> points to a partial
   sequence at the end of a string that could begin a valid 
   character, returns (gunichar)-2; otherwise, if <i class="parameter"><tt>p</tt></i> does not point 
   to a valid UTF-8 encoded Unicode character, returns (gunichar)-1.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133332"></a><h3><a name="g-utf8-offset-to-pointer"></a>g_utf8_offset_to_pointer ()</h3><a class="indexterm" name="id3133344"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_offset_to_pointer        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> offset);</pre><p>
Converts from an integer character offset to a pointer to a position
within the string.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offset</tt></i> :</span></td><td> a character offset within <i class="parameter"><tt>str</tt></i>
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the resulting pointer
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133433"></a><h3><a name="g-utf8-pointer-to-offset"></a>g_utf8_pointer_to_offset ()</h3><a class="indexterm" name="id3133444"></a><pre class="programlisting"><a href="glib-Basic-Types.html#glong">glong</a>       g_utf8_pointer_to_offset        (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *pos);</pre><p>
Converts from a pointer to position within a string to a integer
character offset.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>pos</tt></i> :</span></td><td> a pointer to a position within <i class="parameter"><tt>str</tt></i>
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the resulting character offset
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133533"></a><h3><a name="g-utf8-prev-char"></a>g_utf8_prev_char ()</h3><a class="indexterm" name="id3133544"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_prev_char                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);</pre><p>
Finds the previous UTF-8 character in the string before <i class="parameter"><tt>p</tt></i>.
</p><p>
<i class="parameter"><tt>p</tt></i> does not have to be at the beginning of a UTF-8 character. No check
is made to see if the character found is actually valid other than
it starts with an appropriate byte. If <i class="parameter"><tt>p</tt></i> might be the first
character of the string, you must use <a href="glib-Unicode-Manipulation.html#g-utf8-find-prev-char"><tt class="function">g_utf8_find_prev_char()</tt></a> instead.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a pointer to a position within a UTF-8 encoded string
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found character.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133641"></a><h3><a name="g-utf8-find-next-char"></a>g_utf8_find_next_char ()</h3><a class="indexterm" name="id3133652"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_find_next_char           (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *end);</pre><p>
Finds the start of the next UTF-8 character in the string after <i class="parameter"><tt>p</tt></i>.
</p><p>
<i class="parameter"><tt>p</tt></i> does not have to be at the beginning of a UTF-8 character. No check
is made to see if the character found is actually valid other than
it starts with an appropriate byte.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a pointer to a position within a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>end</tt></i> :</span></td><td> a pointer to the end of the string, or <tt class="literal">NULL</tt> to indicate
       that the string is nul-terminated, in which case
       the returned value will be 
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found character or <tt class="literal">NULL</tt>
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133767"></a><h3><a name="g-utf8-find-prev-char"></a>g_utf8_find_prev_char ()</h3><a class="indexterm" name="id3133778"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_find_prev_char           (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *p);</pre><p>
Given a position <i class="parameter"><tt>p</tt></i> with a UTF-8 encoded string <i class="parameter"><tt>str</tt></i>, find the start
of the previous UTF-8 character starting before <i class="parameter"><tt>p</tt></i>. Returns <tt class="literal">NULL</tt> if no
UTF-8 characters are present in <i class="parameter"><tt>p</tt></i> before <i class="parameter"><tt>str</tt></i>.
</p><p>
<i class="parameter"><tt>p</tt></i> does not have to be at the beginning of a UTF-8 character. No check
is made to see if the character found is actually valid other than
it starts with an appropriate byte.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> pointer to the beginning of a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> pointer to some position within <i class="parameter"><tt>str</tt></i>
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to the found character or <tt class="literal">NULL</tt>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3133920"></a><h3><a name="g-utf8-strlen"></a>g_utf8_strlen ()</h3><a class="indexterm" name="id3133931"></a><pre class="programlisting"><a href="glib-Basic-Types.html#glong">glong</a>       g_utf8_strlen                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max);</pre><p>
Returns the length of the string in characters.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> pointer to the start of a UTF-8 encoded string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>max</tt></i> :</span></td><td> the maximum number of bytes to examine. If <i class="parameter"><tt>max</tt></i>
      is less than 0, then the string is assumed to be
      nul-terminated. If <i class="parameter"><tt>max</tt></i> is 0, <i class="parameter"><tt>p</tt></i> will not be examined and 
      may be <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the length of the string in characters
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134039"></a><h3><a name="g-utf8-strncpy"></a>g_utf8_strncpy ()</h3><a class="indexterm" name="id3134050"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strncpy                  (<a href="glib-Basic-Types.html#gchar">gchar</a> *dest,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *src,
                                             <a href="glib-Basic-Types.html#gsize">gsize</a> n);</pre><p>
Like the standard C <tt class="function">strncpy()</tt> function, but 
copies a given number of characters instead of a given number of 
bytes. The <i class="parameter"><tt>src</tt></i> string must be valid UTF-8 encoded text. 
(Use <a href="glib-Unicode-Manipulation.html#g-utf8-validate"><tt class="function">g_utf8_validate()</tt></a> on all text before trying to use UTF-8 
utility functions with it.)</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>dest</tt></i> :</span></td><td> buffer to fill with characters from <i class="parameter"><tt>src</tt></i>
</td></tr><tr><td><span class="term"><i class="parameter"><tt>src</tt></i> :</span></td><td> UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>n</tt></i> :</span></td><td> character count
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <i class="parameter"><tt>dest</tt></i>
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134194"></a><h3><a name="g-utf8-strchr"></a>g_utf8_strchr ()</h3><a class="indexterm" name="id3134205"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strchr                   (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Finds the leftmost occurrence of the given ISO10646 character
in a UTF-8 encoded string, while limiting the search to <i class="parameter"><tt>len</tt></i> bytes.
If <i class="parameter"><tt>len</tt></i> is -1, allow unbounded search.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a nul-terminated UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>p</tt></i>
</td></tr><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a ISO10646 character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">NULL</tt> if the string does not contain the character, 
  otherwise, a pointer to the start of the leftmost occurrence of 
  the character in the string.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134335"></a><h3><a name="g-utf8-strrchr"></a>g_utf8_strrchr ()</h3><a class="indexterm" name="id3134346"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strrchr                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *p,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>
Find the rightmost occurrence of the given ISO10646 character
in a UTF-8 encoded string, while limiting the search to <i class="parameter"><tt>len</tt></i> bytes.
If <i class="parameter"><tt>len</tt></i> is -1, allow unbounded search.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a nul-terminated UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>p</tt></i>
</td></tr><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a ISO10646 character
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">NULL</tt> if the string does not contain the character, 
  otherwise, a pointer to the start of the rightmost occurrence of the 
  character in the string.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134476"></a><h3><a name="g-utf8-strreverse"></a>g_utf8_strreverse ()</h3><a class="indexterm" name="id3134488"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strreverse               (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Reverses a UTF-8 string. <i class="parameter"><tt>str</tt></i> must be valid UTF-8 encoded text. 
(Use <a href="glib-Unicode-Manipulation.html#g-utf8-validate"><tt class="function">g_utf8_validate()</tt></a> on all text before trying to use UTF-8 
utility functions with it.)
</p><p>
Note that unlike <a href="glib-String-Utility-Functions.html#g-strreverse"><tt class="function">g_strreverse()</tt></a>, this function returns
newly-allocated memory, which should be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a> when
no longer needed.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly-allocated string which is the reverse of <i class="parameter"><tt>str</tt></i>.

</td></tr></tbody></table></div><p>Since  2.2
</p></div><hr><div class="refsect2" lang="en"><a name="id3134637"></a><h3><a name="g-utf8-validate"></a>g_utf8_validate ()</h3><a class="indexterm" name="id3134648"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a>    g_utf8_validate                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> max_len,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> **end);</pre><p>
Validates UTF-8 encoded text. <i class="parameter"><tt>str</tt></i> is the text to validate;
if <i class="parameter"><tt>str</tt></i> is nul-terminated, then <i class="parameter"><tt>max_len</tt></i> can be -1, otherwise
<i class="parameter"><tt>max_len</tt></i> should be the number of bytes to validate.
If <i class="parameter"><tt>end</tt></i> is non-<tt class="literal">NULL</tt>, then the end of the valid range
will be stored there (i.e. the address of the first invalid byte
if some bytes were invalid, or the end of the text being validated
otherwise).
</p><p>
Returns <tt class="literal">TRUE</tt> if all of <i class="parameter"><tt>str</tt></i> was valid. Many GLib and GTK+
routines <span class="emphasis"><em>require</em></span> valid UTF-8 as input;
so data read from a file or the network should be checked
with <a href="glib-Unicode-Manipulation.html#g-utf8-validate"><tt class="function">g_utf8_validate()</tt></a> before doing anything else with it.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a pointer to character data
</td></tr><tr><td><span class="term"><i class="parameter"><tt>max_len</tt></i> :</span></td><td> max bytes to validate, or -1 to go until nul
</td></tr><tr><td><span class="term"><i class="parameter"><tt>end</tt></i> :</span></td><td> return location for end of valid data
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the text was valid UTF-8
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134830"></a><h3><a name="g-utf8-strup"></a>g_utf8_strup ()</h3><a class="indexterm" name="id3134841"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strup                    (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts all Unicode characters in the string that have a case
to uppercase. The exact manner that this is done depends
on the current locale, and may result in the number of
characters in the string increasing. (For instance, the
German ess-zet will be changed to SS.)</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i>, in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string, with all characters
   converted to uppercase.  
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3134940"></a><h3><a name="g-utf8-strdown"></a>g_utf8_strdown ()</h3><a class="indexterm" name="id3134951"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_strdown                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts all Unicode characters in the string that have a case
to lowercase. The exact manner that this is done depends
on the current locale, and may result in the number of
characters in the string changing.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i>, in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string, with all characters
   converted to lowercase.  
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135048"></a><h3><a name="g-utf8-casefold"></a>g_utf8_casefold ()</h3><a class="indexterm" name="id3135059"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_casefold                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts a string into a form that is independent of case. The
result will not correspond to any particular case, but can be
compared for equality or ordered with the results of calling
<a href="glib-Unicode-Manipulation.html#g-utf8-casefold"><tt class="function">g_utf8_casefold()</tt></a> on other strings.
</p><p>
Note that calling <a href="glib-Unicode-Manipulation.html#g-utf8-casefold"><tt class="function">g_utf8_casefold()</tt></a> followed by <a href="glib-Unicode-Manipulation.html#g-utf8-collate"><tt class="function">g_utf8_collate()</tt></a> is
only an approximation to the correct linguistic case insensitive
ordering, though it is a fairly good one. Getting this exactly
right would require a more sophisticated collation function that
takes case sensitivity into account. GLib does not currently
provide such a function.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i>, in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string, that is a
  case independent form of <i class="parameter"><tt>str</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135202"></a><h3><a name="g-utf8-normalize"></a>g_utf8_normalize ()</h3><a class="indexterm" name="id3135213"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_normalize                (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len,
                                             <a href="glib-Unicode-Manipulation.html#GNormalizeMode">GNormalizeMode</a> mode);</pre><p>
Converts a string into canonical form, standardizing
such issues as whether a character with an accent
is represented as a base character and combining
accent or as a single precomposed character. You
should generally call <a href="glib-Unicode-Manipulation.html#g-utf8-normalize"><tt class="function">g_utf8_normalize()</tt></a> before
comparing two Unicode strings.
</p><p>
The normalization mode <tt class="literal">G_NORMALIZE_DEFAULT</tt> only
standardizes differences that do not affect the
text content, such as the above-mentioned accent
representation. <tt class="literal">G_NORMALIZE_ALL</tt> also standardizes
the "compatibility" characters in Unicode, such
as SUPERSCRIPT THREE to the standard forms
(in this case DIGIT THREE). Formatting information
may be lost but for most text operations such
characters should be considered the same.
For example, <a href="glib-Unicode-Manipulation.html#g-utf8-collate"><tt class="function">g_utf8_collate()</tt></a> normalizes
with <tt class="literal">G_NORMALIZE_ALL</tt> as its first step.
</p><p>
<tt class="literal">G_NORMALIZE_DEFAULT_COMPOSE</tt> and <tt class="literal">G_NORMALIZE_ALL_COMPOSE</tt>
are like <tt class="literal">G_NORMALIZE_DEFAULT</tt> and <tt class="literal">G_NORMALIZE_ALL</tt>,
but returned a result with composed forms rather
than a maximally decomposed form. This is often
useful if you intend to convert the string to
a legacy encoding or pass it to a system with
less capable Unicode handling.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i>, in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mode</tt></i> :</span></td><td> the type of normalization to perform.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string, that is the 
  normalized form of <i class="parameter"><tt>str</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135421"></a><h3><a name="GNormalizeMode"></a>enum GNormalizeMode</h3><a class="indexterm" name="id3135432"></a><pre class="programlisting">typedef enum {
  G_NORMALIZE_DEFAULT,
  G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT,
  G_NORMALIZE_DEFAULT_COMPOSE,
  G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE,
  G_NORMALIZE_ALL,
  G_NORMALIZE_NFKD = G_NORMALIZE_ALL,
  G_NORMALIZE_ALL_COMPOSE,
  G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE
} GNormalizeMode;
</pre><p>
Defines how a Unicode string is transformed in a canonical 
form, standardizing such issues as whether a character with an accent is 
represented as a base character and combining accent or as a single precomposed
character. Unicode strings should generally be normalized before comparing them.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><tt class="literal">G_NORMALIZE_DEFAULT</tt></span></td><td>standardize differences that do not affect the
  text content, such as the above-mentioned accent representation.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_NFD</tt></span></td><td>another name for <tt class="literal">G_NORMALIZE_DEFAULT</tt>.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_DEFAULT_COMPOSE</tt></span></td><td>like <tt class="literal">G_NORMALIZE_DEFAULT</tt>, but with composed
  forms rather than a maximally decomposed form.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_NFC</tt></span></td><td>another name for <tt class="literal">G_NORMALIZE_DEFAULT_COMPOSE</tt>.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_ALL</tt></span></td><td>beyond <tt class="literal">G_NORMALIZE_DEFAULT</tt> also standardize the 
  "compatibility" characters in Unicode, such as SUPERSCRIPT THREE to the 
  standard forms (in this case DIGIT THREE). Formatting information may be 
  lost but for most text operations such characters should be considered the 
  same.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_NFKD</tt></span></td><td>another name for <tt class="literal">G_NORMALIZE_ALL</tt>.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_ALL_COMPOSE</tt></span></td><td>like <tt class="literal">G_NORMALIZE_ALL</tt>, but with composed
  forms rather than a maximally decomposed form.
</td></tr><tr><td><span class="term"><tt class="literal">G_NORMALIZE_NFKC</tt></span></td><td>another name for <tt class="literal">G_NORMALIZE_ALL_COMPOSE</tt>.

</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135630"></a><h3><a name="g-utf8-collate"></a>g_utf8_collate ()</h3><a class="indexterm" name="id3135641"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_utf8_collate                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str1,
                                             const <a href="glib-Basic-Types.html#gchar">gchar</a> *str2);</pre><p>
Compares two strings for ordering using the linguistically
correct rules for the current locale. When sorting a large
number of strings, it will be significantly faster to
obtain collation keys with <a href="glib-Unicode-Manipulation.html#g-utf8-collate-key"><tt class="function">g_utf8_collate_key()</tt></a> and 
compare the keys with <tt class="function">strcmp()</tt> when 
sorting instead of sorting the original strings.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> -1 if <i class="parameter"><tt>str1</tt></i> compares before <i class="parameter"><tt>str2</tt></i>, 0 if they
  compare equal, 1 if <i class="parameter"><tt>str1</tt></i> compares after <i class="parameter"><tt>str2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135772"></a><h3><a name="g-utf8-collate-key"></a>g_utf8_collate_key ()</h3><a class="indexterm" name="id3135784"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf8_collate_key              (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#gssize">gssize</a> len);</pre><p>
Converts a string into a collation key that can be compared
with other collation keys using <tt class="function">strcmp()</tt>. 
The results of comparing the collation keys of two strings 
with <tt class="function">strcmp()</tt> will always be the same as 
comparing the two original keys with <a href="glib-Unicode-Manipulation.html#g-utf8-collate"><tt class="function">g_utf8_collate()</tt></a>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>str</tt></i>, in bytes, or -1 if <i class="parameter"><tt>str</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly allocated string. This string should
  be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a> when you are done with it.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135923"></a><h3><a name="g-utf8-to-utf16"></a>g_utf8_to_utf16 ()</h3><a class="indexterm" name="id3135934"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a>*  g_utf8_to_utf16                 (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from UTF-8 to UTF-16. A 0 word will be
added to the result after the converted text.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of bytes read, or <tt class="literal">NULL</tt>.
             If <tt class="literal">NULL</tt>, then <tt class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</tt> will be
             returned in case <i class="parameter"><tt>str</tt></i> contains a trailing partial
             character. If an error occurs then the index of the
             invalid input is stored here.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of words written, or <tt class="literal">NULL</tt>.
                The value stored here does not include the trailing
                0 word.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UTF-16 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3136177"></a><h3><a name="g-utf8-to-ucs4"></a>g_utf8_to_ucs4 ()</h3><a class="indexterm" name="id3136188"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   g_utf8_to_ucs4                  (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from UTF-8 to a 32-bit fixed width
representation as UCS-4. A trailing 0 will be added to the
string after the converted text.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of bytes read, or <tt class="literal">NULL</tt>.
             If <tt class="literal">NULL</tt>, then <tt class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</tt> will be
             returned in case <i class="parameter"><tt>str</tt></i> contains a trailing partial
             character. If an error occurs then the index of the
             invalid input is stored here.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of characters written or <tt class="literal">NULL</tt>.
                The value here stored does not include the trailing 0
                character. 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UCS-4 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3136432"></a><h3><a name="g-utf8-to-ucs4-fast"></a>g_utf8_to_ucs4_fast ()</h3><a class="indexterm" name="id3136443"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   g_utf8_to_ucs4_fast             (const <a href="glib-Basic-Types.html#gchar">gchar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written);</pre><p>
Convert a string from UTF-8 to a 32-bit fixed width
representation as UCS-4, assuming valid UTF-8 input.
This function is roughly twice as fast as <a href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4"><tt class="function">g_utf8_to_ucs4()</tt></a>
but does no error checking on the input.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-8 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store the number of characters in the
                result, or <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UCS-4 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3136591"></a><h3><a name="g-utf16-to-ucs4"></a>g_utf16_to_ucs4 ()</h3><a class="indexterm" name="id3136602"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a>*   g_utf16_to_ucs4                 (const <a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from UTF-16 to UCS-4. The result will be
terminated with a 0 character.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-16 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is terminated with a 0 character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of words read, or <tt class="literal">NULL</tt>.
             If <tt class="literal">NULL</tt>, then <tt class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</tt> will be
             returned in case <i class="parameter"><tt>str</tt></i> contains a trailing partial
             character. If an error occurs then the index of the
             invalid input is stored here.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of characters written, or <tt class="literal">NULL</tt>.
                The value stored here does not include the trailing
                0 character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UCS-4 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3136845"></a><h3><a name="g-utf16-to-utf8"></a>g_utf16_to_utf8 ()</h3><a class="indexterm" name="id3136856"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_utf16_to_utf8                 (const <a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from UTF-16 to UTF-8. The result will be
terminated with a 0 byte.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UTF-16 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is terminated with a 0 character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of words read, or <tt class="literal">NULL</tt>.
             If <tt class="literal">NULL</tt>, then <tt class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</tt> will be
             returned in case <i class="parameter"><tt>str</tt></i> contains a trailing partial
             character. If an error occurs then the index of the
             invalid input is stored here.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of bytes written, or <tt class="literal">NULL</tt>.
                The value stored here does not include the trailing
                0 byte.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UTF-8 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3137100"></a><h3><a name="g-ucs4-to-utf16"></a>g_ucs4_to_utf16 ()</h3><a class="indexterm" name="id3137111"></a><pre class="programlisting"><a href="glib-Unicode-Manipulation.html#gunichar2">gunichar2</a>*  g_ucs4_to_utf16                 (const <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from UCS-4 to UTF-16. A 0 word will be
added to the result after the converted text.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UCS-4 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is terminated with a 0 character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of bytes read, or <tt class="literal">NULL</tt>.
             If an error occurs then the index of the invalid input
             is stored here.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of words written, or <tt class="literal">NULL</tt>.
                The value stored here does not include the trailing
                0 word.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UTF-16 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3137335"></a><h3><a name="g-ucs4-to-utf8"></a>g_ucs4_to_utf8 ()</h3><a class="indexterm" name="id3137346"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>*      g_ucs4_to_utf8                  (const <a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> *str,
                                             <a href="glib-Basic-Types.html#glong">glong</a> len,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_read,
                                             <a href="glib-Basic-Types.html#glong">glong</a> *items_written,
                                             <a href="glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>
Convert a string from a 32-bit fixed width representation as UCS-4.
to UTF-8. The result will be terminated with a 0 byte.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a UCS-4 encoded string
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the maximum length of <i class="parameter"><tt>str</tt></i> to use. If <i class="parameter"><tt>len</tt></i> &lt; 0, then
      the string is terminated with a 0 character.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_read</tt></i> :</span></td><td> location to store number of characters read read, or <tt class="literal">NULL</tt>.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>items_written</tt></i> :</span></td><td> location to store number of bytes written or <tt class="literal">NULL</tt>.
                The value here stored does not include the trailing 0
                byte. 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>error</tt></i> :</span></td><td> location to store the error occuring, or <tt class="literal">NULL</tt> to ignore
        errors. Any of the errors in <a href="glib-Character-Set-Conversion.html#GConvertError"><span class="type">GConvertError</span></a> other than
        <tt class="literal">G_CONVERT_ERROR_NO_CONVERSION</tt> may occur.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a pointer to a newly allocated UTF-8 string.
              This value must be freed with <a href="glib-Memory-Allocation.html#g-free"><tt class="function">g_free()</tt></a>. If an
              error occurs, <tt class="literal">NULL</tt> will be returned and
              <i class="parameter"><tt>error</tt></i> set.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3137569"></a><h3><a name="g-unichar-to-utf8"></a>g_unichar_to_utf8 ()</h3><a class="indexterm" name="id3137581"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a>        g_unichar_to_utf8               (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c,
                                             <a href="glib-Basic-Types.html#gchar">gchar</a> *outbuf);</pre><p>
Converts a single character to UTF-8.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>c</tt></i> :</span></td><td> a ISO10646 character code
</td></tr><tr><td><span class="term"><i class="parameter"><tt>outbuf</tt></i> :</span></td><td> output buffer, must have at least 6 bytes of space.
      If <tt class="literal">NULL</tt>, the length will be computed and returned
      and nothing will be written to <i class="parameter"><tt>outbuf</tt></i>.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> number of bytes written
</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3137677"></a><h2>See Also</h2><p>
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="glib-Character-Set-Conversion.html#g-locale-to-utf8"><tt class="function">g_locale_to_utf8()</tt></a>, <a href="glib-Character-Set-Conversion.html#g-locale-from-utf8"><tt class="function">g_locale_from_utf8()</tt></a></span></td><td><p>
Convenience functions for converting between UTF-8 and the locale encoding. 
</p></td></tr></tbody></table></div><p>
</p></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-Character-Set-Conversion.html"><b>&lt;&lt; Character Set Conversion</b></a></td><td align="right"><a accesskey="n" href="glib-I18N.html"><b>Internationalization &gt;&gt;</b></a></td></tr></table></body></html>