| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Unicode Manipulation</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> |
| <link rel="home" href="index.html" title="GLib Reference Manual"> |
| <link rel="up" href="glib-utilities.html" title="GLib Utilities"> |
| <link rel="prev" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"> |
| <link rel="next" href="glib-Base64-Encoding.html" title="Base64 Encoding"> |
| <meta name="generator" content="GTK-Doc V1.14 (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" id="top" 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-Base64-Encoding.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> |
| </tr> |
| <tr><td colspan="5" class="shortcuts"> |
| <a href="#glib-Unicode-Manipulation.synopsis" class="shortcut">Top</a> |
| | |
| <a href="#glib-Unicode-Manipulation.description" class="shortcut">Description</a> |
| </td></tr> |
| </table> |
| <div class="refentry" title="Unicode Manipulation"> |
| <a name="glib-Unicode-Manipulation"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="glib-Unicode-Manipulation.top_of_page"></a>Unicode Manipulation</span></h2> |
| <p>Unicode Manipulation — functions operating on Unicode characters and UTF-8 strings</p> |
| </td> |
| <td valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsynopsisdiv" title="Synopsis"> |
| <a name="glib-Unicode-Manipulation.synopsis"></a><h2>Synopsis</h2> |
| <pre class="synopsis"> |
| #include <glib.h> |
| |
| typedef <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar">gunichar</a>; |
| typedef <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2">gunichar2</a>; |
| |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-validate" title="g_unichar_validate ()">g_unichar_validate</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isalnum" title="g_unichar_isalnum ()">g_unichar_isalnum</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isalpha" title="g_unichar_isalpha ()">g_unichar_isalpha</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iscntrl" title="g_unichar_iscntrl ()">g_unichar_iscntrl</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isdefined" title="g_unichar_isdefined ()">g_unichar_isdefined</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isdigit" title="g_unichar_isdigit ()">g_unichar_isdigit</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isgraph" title="g_unichar_isgraph ()">g_unichar_isgraph</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-islower" title="g_unichar_islower ()">g_unichar_islower</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-ismark" title="g_unichar_ismark ()">g_unichar_ismark</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isprint" title="g_unichar_isprint ()">g_unichar_isprint</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-ispunct" title="g_unichar_ispunct ()">g_unichar_ispunct</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isspace" title="g_unichar_isspace ()">g_unichar_isspace</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-istitle" title="g_unichar_istitle ()">g_unichar_istitle</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isupper" title="g_unichar_isupper ()">g_unichar_isupper</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isxdigit" title="g_unichar_isxdigit ()">g_unichar_isxdigit</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide" title="g_unichar_iswide ()">g_unichar_iswide</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide-cjk" title="g_unichar_iswide_cjk ()">g_unichar_iswide_cjk</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iszerowidth" title="g_unichar_iszerowidth ()">g_unichar_iszerowidth</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-toupper" title="g_unichar_toupper ()">g_unichar_toupper</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-tolower" title="g_unichar_tolower ()">g_unichar_tolower</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-totitle" title="g_unichar_totitle ()">g_unichar_totitle</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-digit-value" title="g_unichar_digit_value ()">g_unichar_digit_value</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-xdigit-value" title="g_unichar_xdigit_value ()">g_unichar_xdigit_value</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| enum <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeType" title="enum GUnicodeType">GUnicodeType</a>; |
| <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeType" title="enum GUnicodeType"><span class="returnvalue">GUnicodeType</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-type" title="g_unichar_type ()">g_unichar_type</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| enum <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeBreakType" title="enum GUnicodeBreakType">GUnicodeBreakType</a>; |
| <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeBreakType" title="enum GUnicodeBreakType"><span class="returnvalue">GUnicodeBreakType</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-break-type" title="g_unichar_break_type ()">g_unichar_break_type</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-combining-class" title="g_unichar_combining_class ()">g_unichar_combining_class</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> uc</code></em>); |
| <span class="returnvalue">void</span> <a class="link" href="glib-Unicode-Manipulation.html#g-unicode-canonical-ordering" title="g_unicode_canonical_ordering ()">g_unicode_canonical_ordering</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *string</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> len</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-unicode-canonical-decomposition" title="g_unicode_canonical_decomposition ()">g_unicode_canonical_decomposition</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> *result_len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-get-mirror-char" title="g_unichar_get_mirror_char ()">g_unichar_get_mirror_char</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *mirrored_ch</code></em>); |
| enum <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript">GUnicodeScript</a>; |
| <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript"><span class="returnvalue">GUnicodeScript</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-get-script" title="g_unichar_get_script ()">g_unichar_get_script</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>); |
| |
| #define <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-next-char" title="g_utf8_next_char()">g_utf8_next_char</a> (p) |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()">g_utf8_get_char</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char-validated" title="g_utf8_get_char_validated ()">g_utf8_get_char_validated</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max_len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-offset-to-pointer" title="g_utf8_offset_to_pointer ()">g_utf8_offset_to_pointer</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> offset</code></em>); |
| <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="returnvalue">glong</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-pointer-to-offset" title="g_utf8_pointer_to_offset ()">g_utf8_pointer_to_offset</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *pos</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-prev-char" title="g_utf8_prev_char ()">g_utf8_prev_char</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-find-next-char" title="g_utf8_find_next_char ()">g_utf8_find_next_char</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *end</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-find-prev-char" title="g_utf8_find_prev_char ()">g_utf8_find_prev_char</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>); |
| <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="returnvalue">glong</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strlen" title="g_utf8_strlen ()">g_utf8_strlen</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strncpy" title="g_utf8_strncpy ()">g_utf8_strncpy</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *dest</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *src</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> n</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strchr" title="g_utf8_strchr ()">g_utf8_strchr</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strrchr" title="g_utf8_strrchr ()">g_utf8_strrchr</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strreverse" title="g_utf8_strreverse ()">g_utf8_strreverse</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()">g_utf8_validate</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max_len</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **end</code></em>); |
| |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strup" title="g_utf8_strup ()">g_utf8_strup</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strdown" title="g_utf8_strdown ()">g_utf8_strdown</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-casefold" title="g_utf8_casefold ()">g_utf8_casefold</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-normalize" title="g_utf8_normalize ()">g_utf8_normalize</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#GNormalizeMode" title="enum GNormalizeMode"><span class="type">GNormalizeMode</span></a> mode</code></em>); |
| enum <a class="link" href="glib-Unicode-Manipulation.html#GNormalizeMode" title="enum GNormalizeMode">GNormalizeMode</a>; |
| <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate" title="g_utf8_collate ()">g_utf8_collate</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str1</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str2</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate-key" title="g_utf8_collate_key ()">g_utf8_collate_key</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate-key-for-filename" title="g_utf8_collate_key_for_filename ()">g_utf8_collate_key_for_filename</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>); |
| |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="returnvalue">gunichar2</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-utf16" title="g_utf8_to_utf16 ()">g_utf8_to_utf16</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4" title="g_utf8_to_ucs4 ()">g_utf8_to_ucs4</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4-fast" title="g_utf8_to_ucs4_fast ()">g_utf8_to_ucs4_fast</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-utf16-to-ucs4" title="g_utf16_to_ucs4 ()">g_utf16_to_ucs4</a> (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="type">gunichar2</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-utf16-to-utf8" title="g_utf16_to_utf8 ()">g_utf16_to_utf8</a> (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="type">gunichar2</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="returnvalue">gunichar2</span></a> * <a class="link" href="glib-Unicode-Manipulation.html#g-ucs4-to-utf16" title="g_ucs4_to_utf16 ()">g_ucs4_to_utf16</a> (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="glib-Unicode-Manipulation.html#g-ucs4-to-utf8" title="g_ucs4_to_utf8 ()">g_ucs4_to_utf8</a> (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>); |
| <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-to-utf8" title="g_unichar_to_utf8 ()">g_unichar_to_utf8</a> (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *outbuf</code></em>); |
| </pre> |
| </div> |
| <div class="refsect1" title="Description"> |
| <a name="glib-Unicode-Manipulation.description"></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 <code class="filename">ctype.h</code> 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> |
| <p> |
| The implementations of the Unicode functions in GLib are based |
| on the Unicode Character Data tables, which are available from |
| <a class="ulink" href="http://www.unicode.org/" target="_top">www.unicode.org</a>. |
| GLib 2.8 supports Unicode 4.0, GLib 2.10 supports Unicode 4.1, |
| GLib 2.12 supports Unicode 5.0, GLib 2.16.3 supports Unicode 5.1. |
| </p> |
| </div> |
| <div class="refsect1" title="Details"> |
| <a name="glib-Unicode-Manipulation.details"></a><h2>Details</h2> |
| <div class="refsect2" title="gunichar"> |
| <a name="gunichar"></a><h3>gunichar</h3> |
| <pre class="programlisting">typedef guint32 gunichar; |
| </pre> |
| <p> |
| A type which can hold any UTF-32 or UCS-4 character code, also known |
| as a Unicode code point. |
| </p> |
| <p> |
| If you want to produce the UTF-8 representation of a <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a>, |
| use <a class="link" href="glib-Unicode-Manipulation.html#g-ucs4-to-utf8" title="g_ucs4_to_utf8 ()"><code class="function">g_ucs4_to_utf8()</code></a>. See also <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4" title="g_utf8_to_ucs4 ()"><code class="function">g_utf8_to_ucs4()</code></a> for the reverse process. |
| </p> |
| <p> |
| To print/scan values of this type as integer, use |
| <a class="link" href="glib-Miscellaneous-Macros.html#G-GINT32-MODIFIER:CAPS" title="G_GINT32_MODIFIER"><code class="literal">G_GINT32_MODIFIER</code></a> and/or <a class="link" href="glib-Miscellaneous-Macros.html#G-GUINT32-FORMAT:CAPS" title="G_GUINT32_FORMAT"><code class="literal">G_GUINT32_FORMAT</code></a>. |
| </p> |
| <p> |
| The notation to express a Unicode code point in running text is as a |
| hexadecimal number with four to six digits and uppercase letters, prefixed |
| by the string "U+". Leading zeros are omitted, unless the code point would |
| have fewer than four hexadecimal digits. |
| For example, "U+0041 LATIN CAPITAL LETTER A". |
| To print a code point in the U+-notation, use the format string |
| "U+<code class="literal">04</code>"G_GINT32_FORMAT"X". |
| To scan, use the format string "U+<code class="literal">06</code>"G_GINT32_FORMAT"X". |
| </p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c</span><span class="symbol">;</span> |
| <span class="function">sscanf</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"U+0041"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"U+%06"</span><span class="normal"><a href="glib-Miscellaneous-Macros.html#G-GINT32-FORMAT:CAPS">G_GINT32_FORMAT</a></span><span class="string">"X"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">c</span><span class="symbol">)</span> |
| <span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Read U+%04"</span><span class="normal"><a href="glib-Miscellaneous-Macros.html#G-GINT32-FORMAT:CAPS">G_GINT32_FORMAT</a></span><span class="string">"X"</span><span class="symbol">,</span><span class="normal"> c</span><span class="symbol">);</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p> |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="gunichar2"> |
| <a name="gunichar2"></a><h3>gunichar2</h3> |
| <pre class="programlisting">typedef guint16 gunichar2; |
| </pre> |
| <p> |
| A type which can hold any UTF-16 code |
| point<sup>[<a name="utf16_surrogate_pairs" href="#ftn.utf16_surrogate_pairs" class="footnote">3</a>]</sup>. |
| </p> |
| <p> |
| To print/scan values of this type to/from text you need to convert |
| to/from UTF-8, using <a class="link" href="glib-Unicode-Manipulation.html#g-utf16-to-utf8" title="g_utf16_to_utf8 ()"><code class="function">g_utf16_to_utf8()</code></a>/<a class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-utf16" title="g_utf8_to_utf16 ()"><code class="function">g_utf8_to_utf16()</code></a>. |
| </p> |
| <p> |
| To print/scan values of this type as integer, use |
| <a class="link" href="glib-Miscellaneous-Macros.html#G-GINT16-MODIFIER:CAPS" title="G_GINT16_MODIFIER"><code class="literal">G_GINT16_MODIFIER</code></a> and/or <a class="link" href="glib-Miscellaneous-Macros.html#G-GUINT16-FORMAT:CAPS" title="G_GUINT16_FORMAT"><code class="literal">G_GUINT16_FORMAT</code></a>. |
| </p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_validate ()"> |
| <a name="g-unichar-validate"></a><h3>g_unichar_validate ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_validate (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>);</pre> |
| <p> |
| Checks whether <em class="parameter"><code>ch</code></em> is a valid Unicode character. Some possible |
| integer values of <em class="parameter"><code>ch</code></em> will not be valid. 0 is considered a valid |
| character, though it's normally a string terminator. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>ch</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>ch</code></em> is a valid Unicode character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isalnum ()"> |
| <a name="g-unichar-isalnum"></a><h3>g_unichar_isalnum ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isalnum (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is alphanumeric. |
| Given some UTF-8 text, obtain a character value |
| with <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is an alphanumeric character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isalpha ()"> |
| <a name="g-unichar-isalpha"></a><h3>g_unichar_isalpha ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isalpha (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is alphabetic (i.e. a letter). |
| Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is an alphabetic character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_iscntrl ()"> |
| <a name="g-unichar-iscntrl"></a><h3>g_unichar_iscntrl ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_iscntrl (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is a control character. |
| Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a control character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isdefined ()"> |
| <a name="g-unichar-isdefined"></a><h3>g_unichar_isdefined ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isdefined (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a given character is assigned in the Unicode |
| standard. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character has an assigned value |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isdigit ()"> |
| <a name="g-unichar-isdigit"></a><h3>g_unichar_isdigit ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isdigit (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a digit |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isgraph ()"> |
| <a name="g-unichar-isgraph"></a><h3>g_unichar_isgraph ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isgraph (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is printable and not a space |
| (returns <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for control characters, format characters, and |
| spaces). <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isprint" title="g_unichar_isprint ()"><code class="function">g_unichar_isprint()</code></a> is similar, but returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> for |
| spaces. Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is printable unless it's a space |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_islower ()"> |
| <a name="g-unichar-islower"></a><h3>g_unichar_islower ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_islower (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is a lowercase letter. |
| Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a lowercase letter |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_ismark ()"> |
| <a name="g-unichar-ismark"></a><h3>g_unichar_ismark ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_ismark (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is a mark (non-spacing mark, |
| combining mark, or enclosing mark in Unicode speak). |
| Given some UTF-8 text, obtain a character value |
| with <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <p> |
| Note: in most cases where isalpha characters are allowed, |
| ismark characters should be allowed to as they are essential |
| for writing most European languages as well as many non-Latin |
| scripts. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a mark character |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.14</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isprint ()"> |
| <a name="g-unichar-isprint"></a><h3>g_unichar_isprint ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isprint (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is printable. |
| Unlike <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isgraph" title="g_unichar_isgraph ()"><code class="function">g_unichar_isgraph()</code></a>, returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> for spaces. |
| Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is printable |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_ispunct ()"> |
| <a name="g-unichar-ispunct"></a><h3>g_unichar_ispunct ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_ispunct (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines whether a character is punctuation or a symbol. |
| Given some UTF-8 text, obtain a character value with |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a punctuation or symbol character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isspace ()"> |
| <a name="g-unichar-isspace"></a><h3>g_unichar_isspace ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isspace (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is a space character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_istitle ()"> |
| <a name="g-unichar-istitle"></a><h3>g_unichar_istitle ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_istitle (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character is titlecase |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isupper ()"> |
| <a name="g-unichar-isupper"></a><h3>g_unichar_isupper ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isupper (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a character is uppercase. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em> is an uppercase character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_isxdigit ()"> |
| <a name="g-unichar-isxdigit"></a><h3>g_unichar_isxdigit ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_isxdigit (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a character is a hexidecimal digit. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character is a hexadecimal digit |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_iswide ()"> |
| <a name="g-unichar-iswide"></a><h3>g_unichar_iswide ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_iswide (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a character is typically rendered in a double-width |
| cell. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character is wide |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_iswide_cjk ()"> |
| <a name="g-unichar-iswide-cjk"></a><h3>g_unichar_iswide_cjk ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_iswide_cjk (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a character is typically rendered in a double-width |
| cell under legacy East Asian locales. If a character is wide according to |
| <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide" title="g_unichar_iswide ()"><code class="function">g_unichar_iswide()</code></a>, then it is also reported wide with this function, but |
| the converse is not necessarily true. See the |
| <a class="ulink" href="http://www.unicode.org/reports/tr11/" target="_top">Unicode Standard |
| Annex #11</a> for details. |
| </p> |
| <p> |
| If a character passes the <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide" title="g_unichar_iswide ()"><code class="function">g_unichar_iswide()</code></a> test then it will also pass |
| this test, but not the other way around. Note that some characters may |
| pas both this test and <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iszerowidth" title="g_unichar_iszerowidth ()"><code class="function">g_unichar_iszerowidth()</code></a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character is wide in legacy East Asian locales |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.12</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_iszerowidth ()"> |
| <a name="g-unichar-iszerowidth"></a><h3>g_unichar_iszerowidth ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_iszerowidth (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines if a given character typically takes zero width when rendered. |
| The return value is <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> for all non-spacing and enclosing marks |
| (e.g., combining accents), format characters, zero-width |
| space, but not U+00AD SOFT HYPHEN. |
| </p> |
| <p> |
| A typical use of this function is with one of <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide" title="g_unichar_iswide ()"><code class="function">g_unichar_iswide()</code></a> or |
| <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide-cjk" title="g_unichar_iswide_cjk ()"><code class="function">g_unichar_iswide_cjk()</code></a> to determine the number of cells a string occupies |
| when displayed on a grid display (terminals). However, note that not all |
| terminals support zero-width rendering of zero-width marks. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the character has zero width |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.14</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_toupper ()"> |
| <a name="g-unichar-toupper"></a><h3>g_unichar_toupper ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> g_unichar_toupper (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Converts a character to uppercase. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the result of converting <em class="parameter"><code>c</code></em> to uppercase. |
| If <em class="parameter"><code>c</code></em> is not an lowercase or titlecase character, |
| or has no upper case equivalent <em class="parameter"><code>c</code></em> is returned unchanged. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_tolower ()"> |
| <a name="g-unichar-tolower"></a><h3>g_unichar_tolower ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> g_unichar_tolower (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Converts a character to lower case. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the result of converting <em class="parameter"><code>c</code></em> to lower case. |
| If <em class="parameter"><code>c</code></em> is not an upperlower or titlecase character, |
| or has no lowercase equivalent <em class="parameter"><code>c</code></em> is returned unchanged. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_totitle ()"> |
| <a name="g-unichar-totitle"></a><h3>g_unichar_totitle ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> g_unichar_totitle (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Converts a character to the titlecase. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the result of converting <em class="parameter"><code>c</code></em> to titlecase. |
| If <em class="parameter"><code>c</code></em> is not an uppercase or lowercase character, |
| <em class="parameter"><code>c</code></em> is returned unchanged. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_digit_value ()"> |
| <a name="g-unichar-digit-value"></a><h3>g_unichar_digit_value ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_unichar_digit_value (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines the numeric value of a character as a decimal |
| digit. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> If <em class="parameter"><code>c</code></em> is a decimal digit (according to |
| <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isdigit" title="g_unichar_isdigit ()"><code class="function">g_unichar_isdigit()</code></a>), its numeric value. Otherwise, -1. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_xdigit_value ()"> |
| <a name="g-unichar-xdigit-value"></a><h3>g_unichar_xdigit_value ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_unichar_xdigit_value (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines the numeric value of a character as a hexidecimal |
| digit. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> If <em class="parameter"><code>c</code></em> is a hex digit (according to |
| <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isxdigit" title="g_unichar_isxdigit ()"><code class="function">g_unichar_isxdigit()</code></a>), its numeric value. Otherwise, -1. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GUnicodeType"> |
| <a name="GUnicodeType"></a><h3>enum GUnicodeType</h3> |
| <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 from the |
| Unicode specification. |
| See <a class="ulink" href="http://www.unicode.org/Public/UNIDATA/UnicodeData.html" target="_top">http://www.unicode.org/Public/UNIDATA/UnicodeData.html</a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-UNICODE-CONTROL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_CONTROL</code></span></p></td> |
| <td>General category "Other, Control" (Cc) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-FORMAT:CAPS"></a><span class="term"><code class="literal">G_UNICODE_FORMAT</code></span></p></td> |
| <td>General category "Other, Format" (Cf) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-UNASSIGNED:CAPS"></a><span class="term"><code class="literal">G_UNICODE_UNASSIGNED</code></span></p></td> |
| <td>General category "Other, Not Assigned" (Cn) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-PRIVATE-USE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_PRIVATE_USE</code></span></p></td> |
| <td>General category "Other, Private Use" (Co) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SURROGATE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SURROGATE</code></span></p></td> |
| <td>General category "Other, Surrogate" (Cs) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-LOWERCASE-LETTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_LOWERCASE_LETTER</code></span></p></td> |
| <td>General category "Letter, Lowercase" (Ll) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-MODIFIER-LETTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_MODIFIER_LETTER</code></span></p></td> |
| <td>General category "Letter, Modifier" (Lm) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-OTHER-LETTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_OTHER_LETTER</code></span></p></td> |
| <td>General category "Letter, Other" (Lo) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-TITLECASE-LETTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_TITLECASE_LETTER</code></span></p></td> |
| <td>General category "Letter, Titlecase" (Lt) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-UPPERCASE-LETTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_UPPERCASE_LETTER</code></span></p></td> |
| <td>General category "Letter, Uppercase" (Lu) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-COMBINING-MARK:CAPS"></a><span class="term"><code class="literal">G_UNICODE_COMBINING_MARK</code></span></p></td> |
| <td>General category "Mark, Spacing Combining" (Mc) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-ENCLOSING-MARK:CAPS"></a><span class="term"><code class="literal">G_UNICODE_ENCLOSING_MARK</code></span></p></td> |
| <td>General category "Mark, Enclosing" (Me) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-NON-SPACING-MARK:CAPS"></a><span class="term"><code class="literal">G_UNICODE_NON_SPACING_MARK</code></span></p></td> |
| <td>General category "Mark, Nonspacing" (Mn) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-DECIMAL-NUMBER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_DECIMAL_NUMBER</code></span></p></td> |
| <td>General category "Number, Decimal Digit" (Nd) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-LETTER-NUMBER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_LETTER_NUMBER</code></span></p></td> |
| <td>General category "Number, Letter" (Nl) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-OTHER-NUMBER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_OTHER_NUMBER</code></span></p></td> |
| <td>General category "Number, Other" (No) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-CONNECT-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_CONNECT_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Connector" (Pc) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-DASH-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_DASH_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Dash" (Pd) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-CLOSE-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_CLOSE_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Close" (Pe) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-FINAL-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_FINAL_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Final quote" (Pf) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-INITIAL-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_INITIAL_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Initial quote" (Pi) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-OTHER-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_OTHER_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Other" (Po) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-OPEN-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_OPEN_PUNCTUATION</code></span></p></td> |
| <td>General category "Punctuation, Open" (Ps) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-CURRENCY-SYMBOL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_CURRENCY_SYMBOL</code></span></p></td> |
| <td>General category "Symbol, Currency" (Sc) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-MODIFIER-SYMBOL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_MODIFIER_SYMBOL</code></span></p></td> |
| <td>General category "Symbol, Modifier" (Sk) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-MATH-SYMBOL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_MATH_SYMBOL</code></span></p></td> |
| <td>General category "Symbol, Math" (Sm) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-OTHER-SYMBOL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_OTHER_SYMBOL</code></span></p></td> |
| <td>General category "Symbol, Other" (So) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-LINE-SEPARATOR:CAPS"></a><span class="term"><code class="literal">G_UNICODE_LINE_SEPARATOR</code></span></p></td> |
| <td>General category "Separator, Line" (Zl) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-PARAGRAPH-SEPARATOR:CAPS"></a><span class="term"><code class="literal">G_UNICODE_PARAGRAPH_SEPARATOR</code></span></p></td> |
| <td>General category "Separator, Paragraph" (Zp) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SPACE-SEPARATOR:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SPACE_SEPARATOR</code></span></p></td> |
| <td>General category "Separator, Space" (Zs) |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_type ()"> |
| <a name="g-unichar-type"></a><h3>g_unichar_type ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#GUnicodeType" title="enum GUnicodeType"><span class="returnvalue">GUnicodeType</span></a> g_unichar_type (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Classifies a Unicode character by type. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the type of the character. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GUnicodeBreakType"> |
| <a name="GUnicodeBreakType"></a><h3>enum GUnicodeBreakType</h3> |
| <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, |
| G_UNICODE_BREAK_HANGUL_L_JAMO, |
| G_UNICODE_BREAK_HANGUL_V_JAMO, |
| G_UNICODE_BREAK_HANGUL_T_JAMO, |
| G_UNICODE_BREAK_HANGUL_LV_SYLLABLE, |
| G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE |
| } GUnicodeBreakType; |
| </pre> |
| <p> |
| These are the possible line break classifications. |
| The five Hangul types were added in Unicode 4.1, so, has been |
| introduced in GLib 2.10. Note that new types may be added in the future. |
| Applications should be ready to handle unknown values. |
| They may be regarded as <a class="link" href="glib-Unicode-Manipulation.html#G-UNICODE-BREAK-UNKNOWN:CAPS"><code class="literal">G_UNICODE_BREAK_UNKNOWN</code></a>. |
| See <a class="ulink" href="http://www.unicode.org/unicode/reports/tr14/" target="_top">http://www.unicode.org/unicode/reports/tr14/</a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-MANDATORY:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_MANDATORY</code></span></p></td> |
| <td>Mandatory Break (BK) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-CARRIAGE-RETURN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_CARRIAGE_RETURN</code></span></p></td> |
| <td>Carriage Return (CR) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-LINE-FEED:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_LINE_FEED</code></span></p></td> |
| <td>Line Feed (LF) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-COMBINING-MARK:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_COMBINING_MARK</code></span></p></td> |
| <td>Attached Characters and Combining Marks (CM) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-SURROGATE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_SURROGATE</code></span></p></td> |
| <td>Surrogates (SG) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-ZERO-WIDTH-SPACE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_ZERO_WIDTH_SPACE</code></span></p></td> |
| <td>Zero Width Space (ZW) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-INSEPARABLE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_INSEPARABLE</code></span></p></td> |
| <td>Inseparable (IN) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-NON-BREAKING-GLUE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_NON_BREAKING_GLUE</code></span></p></td> |
| <td>Non-breaking ("Glue") (GL) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-CONTINGENT:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_CONTINGENT</code></span></p></td> |
| <td>Contingent Break Opportunity (CB) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-SPACE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_SPACE</code></span></p></td> |
| <td>Space (SP) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-AFTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_AFTER</code></span></p></td> |
| <td>Break Opportunity After (BA) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-BEFORE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_BEFORE</code></span></p></td> |
| <td>Break Opportunity Before (BB) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-BEFORE-AND-AFTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_BEFORE_AND_AFTER</code></span></p></td> |
| <td>Break Opportunity Before and After (B2) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HYPHEN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HYPHEN</code></span></p></td> |
| <td>Hyphen (HY) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-NON-STARTER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_NON_STARTER</code></span></p></td> |
| <td>Nonstarter (NS) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-OPEN-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_OPEN_PUNCTUATION</code></span></p></td> |
| <td>Opening Punctuation (OP) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-CLOSE-PUNCTUATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_CLOSE_PUNCTUATION</code></span></p></td> |
| <td>Closing Punctuation (CL) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-QUOTATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_QUOTATION</code></span></p></td> |
| <td>Ambiguous Quotation (QU) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-EXCLAMATION:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_EXCLAMATION</code></span></p></td> |
| <td>Exclamation/Interrogation (EX) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-IDEOGRAPHIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_IDEOGRAPHIC</code></span></p></td> |
| <td>Ideographic (ID) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-NUMERIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_NUMERIC</code></span></p></td> |
| <td>Numeric (NU) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-INFIX-SEPARATOR:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_INFIX_SEPARATOR</code></span></p></td> |
| <td>Infix Separator (Numeric) (IS) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-SYMBOL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_SYMBOL</code></span></p></td> |
| <td>Symbols Allowing Break After (SY) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-ALPHABETIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_ALPHABETIC</code></span></p></td> |
| <td>Ordinary Alphabetic and Symbol Characters (AL) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-PREFIX:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_PREFIX</code></span></p></td> |
| <td>Prefix (Numeric) (PR) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-POSTFIX:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_POSTFIX</code></span></p></td> |
| <td>Postfix (Numeric) (PO) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-COMPLEX-CONTEXT:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_COMPLEX_CONTEXT</code></span></p></td> |
| <td>Complex Content Dependent (South East Asian) (SA) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-AMBIGUOUS:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_AMBIGUOUS</code></span></p></td> |
| <td>Ambiguous (Alphabetic or Ideographic) (AI) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_UNKNOWN</code></span></p></td> |
| <td>Unknown (XX) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-NEXT-LINE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_NEXT_LINE</code></span></p></td> |
| <td>Next Line (NL) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-WORD-JOINER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_WORD_JOINER</code></span></p></td> |
| <td>Word Joiner (WJ) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HANGUL-L-JAMO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HANGUL_L_JAMO</code></span></p></td> |
| <td>Hangul L Jamo (JL) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HANGUL-V-JAMO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HANGUL_V_JAMO</code></span></p></td> |
| <td>Hangul V Jamo (JV) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HANGUL-T-JAMO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HANGUL_T_JAMO</code></span></p></td> |
| <td>Hangul T Jamo (JT) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HANGUL-LV-SYLLABLE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HANGUL_LV_SYLLABLE</code></span></p></td> |
| <td>Hangul LV Syllable (H2) |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-BREAK-HANGUL-LVT-SYLLABLE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE</code></span></p></td> |
| <td>Hangul LVT Syllable (H3) |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_break_type ()"> |
| <a name="g-unichar-break-type"></a><h3>g_unichar_break_type ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#GUnicodeBreakType" title="enum GUnicodeBreakType"><span class="returnvalue">GUnicodeBreakType</span></a> g_unichar_break_type (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Determines the break type of <em class="parameter"><code>c</code></em>. <em class="parameter"><code>c</code></em> should be a Unicode character |
| (to derive a character from UTF-8 encoded text, use |
| <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char" title="g_utf8_get_char ()"><code class="function">g_utf8_get_char()</code></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 <a href="/usr/share/gtk-doc/html/pango/pango-Text-Processing.html#pango-break"><code class="function">pango_break()</code></a> instead of caring about break types yourself. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the break type of <em class="parameter"><code>c</code></em> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_combining_class ()"> |
| <a name="g-unichar-combining-class"></a><h3>g_unichar_combining_class ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_unichar_combining_class (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> uc</code></em>);</pre> |
| <p> |
| Determines the canonical combining class of a Unicode character. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>uc</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the combining class of the character |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.14</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unicode_canonical_ordering ()"> |
| <a name="g-unicode-canonical-ordering"></a><h3>g_unicode_canonical_ordering ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> g_unicode_canonical_ordering (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *string</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> len</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td> |
| <td>a UCS-4 encoded string. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>string</code></em> to use. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unicode_canonical_decomposition ()"> |
| <a name="g-unicode-canonical-decomposition"></a><h3>g_unicode_canonical_decomposition ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * g_unicode_canonical_decomposition (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> *result_len</code></em>);</pre> |
| <p> |
| Computes the canonical decomposition of a Unicode character. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>ch</code></em> :</span></p></td> |
| <td>a Unicode character. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>result_len</code></em> :</span></p></td> |
| <td>location to store the length of the return value. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string of Unicode characters. |
| <em class="parameter"><code>result_len</code></em> is set to the resulting length of the string. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_get_mirror_char ()"> |
| <a name="g-unichar-get-mirror-char"></a><h3>g_unichar_get_mirror_char ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_unichar_get_mirror_char (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *mirrored_ch</code></em>);</pre> |
| <p> |
| In Unicode, some characters are <em class="firstterm">mirrored</em>. 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 <em class="parameter"><code>ch</code></em> has the Unicode mirrored property and there is another unicode |
| character that typically has a glyph that is the mirror image of <em class="parameter"><code>ch</code></em>'s |
| glyph and <em class="parameter"><code>mirrored_ch</code></em> is set, it puts that character in the address |
| pointed to by <em class="parameter"><code>mirrored_ch</code></em>. Otherwise the original character is put. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>ch</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>mirrored_ch</code></em> :</span></p></td> |
| <td>location to store the mirrored character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>ch</code></em> has a mirrored character, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> otherwise |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.4</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GUnicodeScript"> |
| <a name="GUnicodeScript"></a><h3>enum GUnicodeScript</h3> |
| <pre class="programlisting">typedef enum |
| { /* ISO 15924 code */ |
| G_UNICODE_SCRIPT_INVALID_CODE = -1, |
| G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */ |
| G_UNICODE_SCRIPT_INHERITED, /* Qaai */ |
| G_UNICODE_SCRIPT_ARABIC, /* Arab */ |
| G_UNICODE_SCRIPT_ARMENIAN, /* Armn */ |
| G_UNICODE_SCRIPT_BENGALI, /* Beng */ |
| G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */ |
| G_UNICODE_SCRIPT_CHEROKEE, /* Cher */ |
| G_UNICODE_SCRIPT_COPTIC, /* Qaac */ |
| G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */ |
| G_UNICODE_SCRIPT_DESERET, /* Dsrt */ |
| G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */ |
| G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */ |
| G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */ |
| G_UNICODE_SCRIPT_GOTHIC, /* Goth */ |
| G_UNICODE_SCRIPT_GREEK, /* Grek */ |
| G_UNICODE_SCRIPT_GUJARATI, /* Gujr */ |
| G_UNICODE_SCRIPT_GURMUKHI, /* Guru */ |
| G_UNICODE_SCRIPT_HAN, /* Hani */ |
| G_UNICODE_SCRIPT_HANGUL, /* Hang */ |
| G_UNICODE_SCRIPT_HEBREW, /* Hebr */ |
| G_UNICODE_SCRIPT_HIRAGANA, /* Hira */ |
| G_UNICODE_SCRIPT_KANNADA, /* Knda */ |
| G_UNICODE_SCRIPT_KATAKANA, /* Kana */ |
| G_UNICODE_SCRIPT_KHMER, /* Khmr */ |
| G_UNICODE_SCRIPT_LAO, /* Laoo */ |
| G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */ |
| G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */ |
| G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */ |
| G_UNICODE_SCRIPT_MYANMAR, /* Mymr */ |
| G_UNICODE_SCRIPT_OGHAM, /* Ogam */ |
| G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */ |
| G_UNICODE_SCRIPT_ORIYA, /* Orya */ |
| G_UNICODE_SCRIPT_RUNIC, /* Runr */ |
| G_UNICODE_SCRIPT_SINHALA, /* Sinh */ |
| G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */ |
| G_UNICODE_SCRIPT_TAMIL, /* Taml */ |
| G_UNICODE_SCRIPT_TELUGU, /* Telu */ |
| G_UNICODE_SCRIPT_THAANA, /* Thaa */ |
| G_UNICODE_SCRIPT_THAI, /* Thai */ |
| G_UNICODE_SCRIPT_TIBETAN, /* Tibt */ |
| G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */ |
| G_UNICODE_SCRIPT_YI, /* Yiii */ |
| G_UNICODE_SCRIPT_TAGALOG, /* Tglg */ |
| G_UNICODE_SCRIPT_HANUNOO, /* Hano */ |
| G_UNICODE_SCRIPT_BUHID, /* Buhd */ |
| G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */ |
| |
| /* Unicode-4.0 additions */ |
| G_UNICODE_SCRIPT_BRAILLE, /* Brai */ |
| G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */ |
| G_UNICODE_SCRIPT_LIMBU, /* Limb */ |
| G_UNICODE_SCRIPT_OSMANYA, /* Osma */ |
| G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */ |
| G_UNICODE_SCRIPT_LINEAR_B, /* Linb */ |
| G_UNICODE_SCRIPT_TAI_LE, /* Tale */ |
| G_UNICODE_SCRIPT_UGARITIC, /* Ugar */ |
| |
| /* Unicode-4.1 additions */ |
| G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */ |
| G_UNICODE_SCRIPT_BUGINESE, /* Bugi */ |
| G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */ |
| G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */ |
| G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */ |
| G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */ |
| G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */ |
| |
| /* Unicode-5.0 additions */ |
| G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */ |
| G_UNICODE_SCRIPT_BALINESE, /* Bali */ |
| G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */ |
| G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */ |
| G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */ |
| G_UNICODE_SCRIPT_NKO, /* Nkoo */ |
| |
| /* Unicode-5.1 additions */ |
| G_UNICODE_SCRIPT_KAYAH_LI, /* Kali */ |
| G_UNICODE_SCRIPT_LEPCHA, /* Lepc */ |
| G_UNICODE_SCRIPT_REJANG, /* Rjng */ |
| G_UNICODE_SCRIPT_SUNDANESE, /* Sund */ |
| G_UNICODE_SCRIPT_SAURASHTRA, /* Saur */ |
| G_UNICODE_SCRIPT_CHAM, /* Cham */ |
| G_UNICODE_SCRIPT_OL_CHIKI, /* Olck */ |
| G_UNICODE_SCRIPT_VAI, /* Vaii */ |
| G_UNICODE_SCRIPT_CARIAN, /* Cari */ |
| G_UNICODE_SCRIPT_LYCIAN, /* Lyci */ |
| G_UNICODE_SCRIPT_LYDIAN /* Lydi */ |
| } GUnicodeScript; |
| </pre> |
| <p> |
| The <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript"><span class="type">GUnicodeScript</span></a> enumeration identifies different writing |
| systems. The values correspond to the names as defined in the |
| Unicode standard. The enumeration has been added in GLib 2.14, |
| and is interchangeable with <a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoScript"><span class="type">PangoScript</span></a>. |
| Note that new types may be added in the future. Applications |
| should be ready to handle unknown values. |
| See <a class="ulink" href="http://www.unicode.org/reports/tr24/" target="_top">Unicode Standard Annex |
| #24: Script names</a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-INVALID-CODE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_INVALID_CODE</code></span></p></td> |
| <td>a value never returned from <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-get-script" title="g_unichar_get_script ()"><code class="function">g_unichar_get_script()</code></a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-COMMON:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_COMMON</code></span></p></td> |
| <td> a character used by multiple different scripts |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-INHERITED:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_INHERITED</code></span></p></td> |
| <td> a mark glyph that takes its script from the |
| base glyph to which it is attached |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-ARABIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_ARABIC</code></span></p></td> |
| <td> Arabic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-ARMENIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_ARMENIAN</code></span></p></td> |
| <td> Armenian |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BENGALI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BENGALI</code></span></p></td> |
| <td> Bengali |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BOPOMOFO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BOPOMOFO</code></span></p></td> |
| <td> Bopomofo |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CHEROKEE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CHEROKEE</code></span></p></td> |
| <td> Cherokee |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-COPTIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_COPTIC</code></span></p></td> |
| <td> Coptic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CYRILLIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CYRILLIC</code></span></p></td> |
| <td> Cyrillic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-DESERET:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_DESERET</code></span></p></td> |
| <td> Deseret |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-DEVANAGARI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_DEVANAGARI</code></span></p></td> |
| <td>Devanagari |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-ETHIOPIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_ETHIOPIC</code></span></p></td> |
| <td> Ethiopic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GEORGIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GEORGIAN</code></span></p></td> |
| <td> Georgian |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GOTHIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GOTHIC</code></span></p></td> |
| <td> Gothic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GREEK:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GREEK</code></span></p></td> |
| <td> Greek |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GUJARATI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GUJARATI</code></span></p></td> |
| <td> Gujarati |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GURMUKHI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GURMUKHI</code></span></p></td> |
| <td> Gurmukhi |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-HAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_HAN</code></span></p></td> |
| <td> Han |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-HANGUL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_HANGUL</code></span></p></td> |
| <td> Hangul |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-HEBREW:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_HEBREW</code></span></p></td> |
| <td> Hebrew |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-HIRAGANA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_HIRAGANA</code></span></p></td> |
| <td> Hiragana |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-KANNADA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_KANNADA</code></span></p></td> |
| <td> Kannada |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-KATAKANA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_KATAKANA</code></span></p></td> |
| <td> Katakana |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-KHMER:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_KHMER</code></span></p></td> |
| <td> Khmer |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LAO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LAO</code></span></p></td> |
| <td> Lao |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LATIN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LATIN</code></span></p></td> |
| <td> Latin |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-MALAYALAM:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_MALAYALAM</code></span></p></td> |
| <td> Malayalam |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-MONGOLIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_MONGOLIAN</code></span></p></td> |
| <td> Mongolian |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-MYANMAR:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_MYANMAR</code></span></p></td> |
| <td> Myanmar |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-OGHAM:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_OGHAM</code></span></p></td> |
| <td> Ogham |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-OLD-ITALIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_OLD_ITALIC</code></span></p></td> |
| <td>Old Italic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-ORIYA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_ORIYA</code></span></p></td> |
| <td> Oriya |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-RUNIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_RUNIC</code></span></p></td> |
| <td> Runic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SINHALA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SINHALA</code></span></p></td> |
| <td> Sinhala |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SYRIAC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SYRIAC</code></span></p></td> |
| <td> Syriac |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TAMIL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TAMIL</code></span></p></td> |
| <td> Tamil |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TELUGU:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TELUGU</code></span></p></td> |
| <td> Telugu |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-THAANA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_THAANA</code></span></p></td> |
| <td> Thaana |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-THAI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_THAI</code></span></p></td> |
| <td> Thai |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TIBETAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TIBETAN</code></span></p></td> |
| <td> Tibetan |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CANADIAN-ABORIGINAL:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL</code></span></p></td> |
| <td> |
| Canadian Aboriginal |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-YI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_YI</code></span></p></td> |
| <td> Yi |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TAGALOG:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TAGALOG</code></span></p></td> |
| <td> Tagalog |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-HANUNOO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_HANUNOO</code></span></p></td> |
| <td> Hanunoo |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BUHID:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BUHID</code></span></p></td> |
| <td> Buhid |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TAGBANWA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TAGBANWA</code></span></p></td> |
| <td> Tagbanwa |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BRAILLE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BRAILLE</code></span></p></td> |
| <td> Braille |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CYPRIOT:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CYPRIOT</code></span></p></td> |
| <td> Cypriot |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LIMBU:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LIMBU</code></span></p></td> |
| <td> Limbu |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-OSMANYA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_OSMANYA</code></span></p></td> |
| <td> Osmanya |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SHAVIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SHAVIAN</code></span></p></td> |
| <td> Shavian |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LINEAR-B:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LINEAR_B</code></span></p></td> |
| <td> Linear B |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TAI-LE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TAI_LE</code></span></p></td> |
| <td> Tai Le |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-UGARITIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_UGARITIC</code></span></p></td> |
| <td> Ugaritic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-NEW-TAI-LUE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_NEW_TAI_LUE</code></span></p></td> |
| <td>New Tai Lue |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BUGINESE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BUGINESE</code></span></p></td> |
| <td> Buginese |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-GLAGOLITIC:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_GLAGOLITIC</code></span></p></td> |
| <td>Glagolitic |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-TIFINAGH:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_TIFINAGH</code></span></p></td> |
| <td> Tifinagh |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SYLOTI-NAGRI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SYLOTI_NAGRI</code></span></p></td> |
| <td>Syloti Nagri |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-OLD-PERSIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_OLD_PERSIAN</code></span></p></td> |
| <td>Old Persian |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-KHAROSHTHI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_KHAROSHTHI</code></span></p></td> |
| <td>Kharoshthi |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_UNKNOWN</code></span></p></td> |
| <td> an unassigned code point |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-BALINESE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_BALINESE</code></span></p></td> |
| <td> Balinese |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CUNEIFORM:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CUNEIFORM</code></span></p></td> |
| <td> Cuneiform |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-PHOENICIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_PHOENICIAN</code></span></p></td> |
| <td>Phoenician |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-PHAGS-PA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_PHAGS_PA</code></span></p></td> |
| <td> Phags-pa |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-NKO:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_NKO</code></span></p></td> |
| <td> N'Ko |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-KAYAH-LI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_KAYAH_LI</code></span></p></td> |
| <td> Kayah Li. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LEPCHA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LEPCHA</code></span></p></td> |
| <td> Lepcha. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-REJANG:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_REJANG</code></span></p></td> |
| <td> Rejang. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SUNDANESE:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SUNDANESE</code></span></p></td> |
| <td> Sundanese. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-SAURASHTRA:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_SAURASHTRA</code></span></p></td> |
| <td>Saurashtra. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CHAM:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CHAM</code></span></p></td> |
| <td> Cham. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-OL-CHIKI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_OL_CHIKI</code></span></p></td> |
| <td> Ol Chiki. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-VAI:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_VAI</code></span></p></td> |
| <td> Vai. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-CARIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_CARIAN</code></span></p></td> |
| <td> Carian. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LYCIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LYCIAN</code></span></p></td> |
| <td> Lycian. Since 2.16.3 |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-UNICODE-SCRIPT-LYDIAN:CAPS"></a><span class="term"><code class="literal">G_UNICODE_SCRIPT_LYDIAN</code></span></p></td> |
| <td> Lydian. Since 2.16.3 |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_get_script ()"> |
| <a name="g-unichar-get-script"></a><h3>g_unichar_get_script ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript"><span class="returnvalue">GUnicodeScript</span></a> g_unichar_get_script (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> ch</code></em>);</pre> |
| <p> |
| Looks up the <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript"><span class="type">GUnicodeScript</span></a> for a particular character (as defined |
| by Unicode Standard Annex <span class="type">24</span>). No check is made for <em class="parameter"><code>ch</code></em> being a |
| valid Unicode character; if you pass in invalid character, the |
| result is undefined. |
| </p> |
| <p> |
| This function is equivalent to <a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#pango-script-for-unichar"><code class="function">pango_script_for_unichar()</code></a> and the |
| two are interchangeable. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>ch</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the <a class="link" href="glib-Unicode-Manipulation.html#GUnicodeScript" title="enum GUnicodeScript"><span class="type">GUnicodeScript</span></a> for the character. |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.14</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_next_char()"> |
| <a name="g-utf8-next-char"></a><h3>g_utf8_next_char()</h3> |
| <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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()"><code class="function">g_utf8_validate()</code></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><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>Pointer to the start of a valid UTF-8 character. |
| </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_get_char ()"> |
| <a name="g-utf8-get-char"></a><h3>g_utf8_get_char ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> g_utf8_get_char (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>);</pre> |
| <p> |
| Converts a sequence of bytes encoded as UTF-8 to a Unicode character. |
| If <em class="parameter"><code>p</code></em> 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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-get-char-validated" title="g_utf8_get_char_validated ()"><code class="function">g_utf8_get_char_validated()</code></a> |
| instead. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a pointer to Unicode character encoded as UTF-8 |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the resulting character |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_get_char_validated ()"> |
| <a name="g-utf8-get-char-validated"></a><h3>g_utf8_get_char_validated ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> g_utf8_get_char_validated (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max_len</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a pointer to Unicode character encoded as UTF-8 |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>max_len</code></em> :</span></p></td> |
| <td>the maximum number of bytes to read, or -1, for no maximum or |
| if <em class="parameter"><code>p</code></em> is nul-terminated |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the resulting character. If <em class="parameter"><code>p</code></em> points to a partial |
| sequence at the end of a string that could begin a valid |
| character (or if <em class="parameter"><code>max_len</code></em> is zero), returns (gunichar)-2; |
| otherwise, if <em class="parameter"><code>p</code></em> does not point to a valid UTF-8 encoded |
| Unicode character, returns (gunichar)-1. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_offset_to_pointer ()"> |
| <a name="g-utf8-offset-to-pointer"></a><h3>g_utf8_offset_to_pointer ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_offset_to_pointer (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> offset</code></em>);</pre> |
| <p> |
| Converts from an integer character offset to a pointer to a position |
| within the string. |
| </p> |
| <p> |
| Since 2.10, this function allows to pass a negative <em class="parameter"><code>offset</code></em> to |
| step backwards. It is usually worth stepping backwards from the end |
| instead of forwards if <em class="parameter"><code>offset</code></em> is in the last fourth of the string, |
| since moving forward is about 3 times faster than moving backward. |
| </p> |
| <p> |
| </p> |
| <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
| <h3 class="title">Note</h3> |
| <p> |
| This function doesn't abort when reaching the end of <em class="parameter"><code>str</code></em>. Therefore |
| you should be sure that <em class="parameter"><code>offset</code></em> is within string boundaries before |
| calling that function. Call <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strlen" title="g_utf8_strlen ()"><code class="function">g_utf8_strlen()</code></a> when unsure. |
| </p> |
| <p> |
| This limitation exists as this function is called frequently during |
| text rendering and therefore has to be as fast as possible. |
| </p> |
| </div> |
| <p> |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td> |
| <td>a character offset within <em class="parameter"><code>str</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the resulting pointer |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_pointer_to_offset ()"> |
| <a name="g-utf8-pointer-to-offset"></a><h3>g_utf8_pointer_to_offset ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="returnvalue">glong</span></a> g_utf8_pointer_to_offset (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *pos</code></em>);</pre> |
| <p> |
| Converts from a pointer to position within a string to a integer |
| character offset. |
| </p> |
| <p> |
| Since 2.10, this function allows <em class="parameter"><code>pos</code></em> to be before <em class="parameter"><code>str</code></em>, and returns |
| a negative offset in this case. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>pos</code></em> :</span></p></td> |
| <td>a pointer to a position within <em class="parameter"><code>str</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the resulting character offset |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_prev_char ()"> |
| <a name="g-utf8-prev-char"></a><h3>g_utf8_prev_char ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_prev_char (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>);</pre> |
| <p> |
| Finds the previous UTF-8 character in the string before <em class="parameter"><code>p</code></em>. |
| </p> |
| <p> |
| <em class="parameter"><code>p</code></em> 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 <em class="parameter"><code>p</code></em> might be the first |
| character of the string, you must use <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-find-prev-char" title="g_utf8_find_prev_char ()"><code class="function">g_utf8_find_prev_char()</code></a> instead. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a pointer to a position within a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the found character. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_find_next_char ()"> |
| <a name="g-utf8-find-next-char"></a><h3>g_utf8_find_next_char ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_find_next_char (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *end</code></em>);</pre> |
| <p> |
| Finds the start of the next UTF-8 character in the string after <em class="parameter"><code>p</code></em>. |
| </p> |
| <p> |
| <em class="parameter"><code>p</code></em> 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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a pointer to a position within a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>end</code></em> :</span></p></td> |
| <td>a pointer to the byte following the end of the string, |
| or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to indicate that the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the found character or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_find_prev_char ()"> |
| <a name="g-utf8-find-prev-char"></a><h3>g_utf8_find_prev_char ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_find_prev_char (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>);</pre> |
| <p> |
| Given a position <em class="parameter"><code>p</code></em> with a UTF-8 encoded string <em class="parameter"><code>str</code></em>, find the start |
| of the previous UTF-8 character starting before <em class="parameter"><code>p</code></em>. Returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if no |
| UTF-8 characters are present in <em class="parameter"><code>str</code></em> before <em class="parameter"><code>p</code></em>. |
| </p> |
| <p> |
| <em class="parameter"><code>p</code></em> 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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>pointer to the beginning of a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>pointer to some position within <em class="parameter"><code>str</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to the found character or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_strlen ()"> |
| <a name="g-utf8-strlen"></a><h3>g_utf8_strlen ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="returnvalue">glong</span></a> g_utf8_strlen (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max</code></em>);</pre> |
| <p> |
| Computes the length of the string in characters, not including |
| the terminating nul character. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>pointer to the start of a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td> |
| <td>the maximum number of bytes to examine. If <em class="parameter"><code>max</code></em> |
| is less than 0, then the string is assumed to be |
| nul-terminated. If <em class="parameter"><code>max</code></em> is 0, <em class="parameter"><code>p</code></em> will not be examined and |
| may be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> the length of the string in characters |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_strncpy ()"> |
| <a name="g-utf8-strncpy"></a><h3>g_utf8_strncpy ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_strncpy (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *dest</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *src</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> n</code></em>);</pre> |
| <p> |
| Like the standard C <code class="function">strncpy()</code> function, but |
| copies a given number of characters instead of a given number of |
| bytes. The <em class="parameter"><code>src</code></em> string must be valid UTF-8 encoded text. |
| (Use <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()"><code class="function">g_utf8_validate()</code></a> on all text before trying to use UTF-8 |
| utility functions with it.) |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td> |
| <td>buffer to fill with characters from <em class="parameter"><code>src</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td> |
| <td>UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td> |
| <td>character count |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <em class="parameter"><code>dest</code></em> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_strchr ()"> |
| <a name="g-utf8-strchr"></a><h3>g_utf8_strchr ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_strchr (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Finds the leftmost occurrence of the given Unicode character |
| in a UTF-8 encoded string, while limiting the search to <em class="parameter"><code>len</code></em> bytes. |
| If <em class="parameter"><code>len</code></em> is -1, allow unbounded search. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a nul-terminated UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>p</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> 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" title="g_utf8_strrchr ()"> |
| <a name="g-utf8-strrchr"></a><h3>g_utf8_strrchr ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_strrchr (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *p</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>);</pre> |
| <p> |
| Find the rightmost occurrence of the given Unicode character |
| in a UTF-8 encoded string, while limiting the search to <em class="parameter"><code>len</code></em> bytes. |
| If <em class="parameter"><code>len</code></em> is -1, allow unbounded search. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td> |
| <td>a nul-terminated UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>p</code></em> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> 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" title="g_utf8_strreverse ()"> |
| <a name="g-utf8-strreverse"></a><h3>g_utf8_strreverse ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf8_strreverse (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</pre> |
| <p> |
| Reverses a UTF-8 string. <em class="parameter"><code>str</code></em> must be valid UTF-8 encoded text. |
| (Use <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()"><code class="function">g_utf8_validate()</code></a> on all text before trying to use UTF-8 |
| utility functions with it.) |
| </p> |
| <p> |
| This function is intended for programmatic uses of reversed strings. |
| It pays no attention to decomposed characters, combining marks, byte |
| order marks, directional indicators (LRM, LRO, etc) and similar |
| characters which might need special handling when reversing a string |
| for display purposes. |
| </p> |
| <p> |
| Note that unlike <a class="link" href="glib-String-Utility-Functions.html#g-strreverse" title="g_strreverse ()"><code class="function">g_strreverse()</code></a>, this function returns |
| newly-allocated memory, which should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when |
| no longer needed. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>str</code></em> to use, in bytes. If <em class="parameter"><code>len</code></em> < 0, |
| then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly-allocated string which is the reverse of <em class="parameter"><code>str</code></em>. |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.2</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_validate ()"> |
| <a name="g-utf8-validate"></a><h3>g_utf8_validate ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_utf8_validate (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> max_len</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **end</code></em>);</pre> |
| <p> |
| Validates UTF-8 encoded text. <em class="parameter"><code>str</code></em> is the text to validate; |
| if <em class="parameter"><code>str</code></em> is nul-terminated, then <em class="parameter"><code>max_len</code></em> can be -1, otherwise |
| <em class="parameter"><code>max_len</code></em> should be the number of bytes to validate. |
| If <em class="parameter"><code>end</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, then the end of the valid range |
| will be stored there (i.e. the start of the first invalid |
| character if some bytes were invalid, or the end of the text |
| being validated otherwise). |
| </p> |
| <p> |
| Note that <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()"><code class="function">g_utf8_validate()</code></a> returns <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if <em class="parameter"><code>max_len</code></em> is |
| positive and NUL is met before <em class="parameter"><code>max_len</code></em> bytes have been read. |
| </p> |
| <p> |
| Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if all of <em class="parameter"><code>str</code></em> 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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-validate" title="g_utf8_validate ()"><code class="function">g_utf8_validate()</code></a> before doing anything else with it. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a pointer to character data |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>max_len</code></em> :</span></p></td> |
| <td>max bytes to validate, or -1 to go until NUL |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>end</code></em> :</span></p></td> |
| <td>return location for end of valid data |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the text was valid UTF-8 |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_strup ()"> |
| <a name="g-utf8-strup"></a><h3>g_utf8_strup ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_strup (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string, with all characters |
| converted to uppercase. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_strdown ()"> |
| <a name="g-utf8-strdown"></a><h3>g_utf8_strdown ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_strdown (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string, with all characters |
| converted to lowercase. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_casefold ()"> |
| <a name="g-utf8-casefold"></a><h3>g_utf8_casefold ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_casefold (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-casefold" title="g_utf8_casefold ()"><code class="function">g_utf8_casefold()</code></a> on other strings. |
| </p> |
| <p> |
| Note that calling <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-casefold" title="g_utf8_casefold ()"><code class="function">g_utf8_casefold()</code></a> followed by <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate" title="g_utf8_collate ()"><code class="function">g_utf8_collate()</code></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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string, that is a |
| case independent form of <em class="parameter"><code>str</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_normalize ()"> |
| <a name="g-utf8-normalize"></a><h3>g_utf8_normalize ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_normalize (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#GNormalizeMode" title="enum GNormalizeMode"><span class="type">GNormalizeMode</span></a> mode</code></em>);</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. The |
| string has to be valid UTF-8, otherwise <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> is |
| returned. You should generally call <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-normalize" title="g_utf8_normalize ()"><code class="function">g_utf8_normalize()</code></a> |
| before comparing two Unicode strings. |
| </p> |
| <p> |
| The normalization mode <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT:CAPS"><code class="literal">G_NORMALIZE_DEFAULT</code></a> only |
| standardizes differences that do not affect the |
| text content, such as the above-mentioned accent |
| representation. <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL:CAPS"><code class="literal">G_NORMALIZE_ALL</code></a> 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. |
| </p> |
| <p> |
| <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT-COMPOSE:CAPS"><code class="literal">G_NORMALIZE_DEFAULT_COMPOSE</code></a> and <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL-COMPOSE:CAPS"><code class="literal">G_NORMALIZE_ALL_COMPOSE</code></a> |
| are like <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT:CAPS"><code class="literal">G_NORMALIZE_DEFAULT</code></a> and <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL:CAPS"><code class="literal">G_NORMALIZE_ALL</code></a>, |
| 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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td> |
| <td>the type of normalization to perform. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string, that is the |
| normalized form of <em class="parameter"><code>str</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>str</code></em> is not |
| valid UTF-8. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="enum GNormalizeMode"> |
| <a name="GNormalizeMode"></a><h3>enum GNormalizeMode</h3> |
| <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><p><a name="G-NORMALIZE-DEFAULT:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_DEFAULT</code></span></p></td> |
| <td>standardize differences that do not affect the |
| text content, such as the above-mentioned accent representation. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-NFD:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_NFD</code></span></p></td> |
| <td>another name for <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT:CAPS"><code class="literal">G_NORMALIZE_DEFAULT</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-DEFAULT-COMPOSE:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_DEFAULT_COMPOSE</code></span></p></td> |
| <td>like <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT:CAPS"><code class="literal">G_NORMALIZE_DEFAULT</code></a>, but with composed |
| forms rather than a maximally decomposed form. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-NFC:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_NFC</code></span></p></td> |
| <td>another name for <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT-COMPOSE:CAPS"><code class="literal">G_NORMALIZE_DEFAULT_COMPOSE</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-ALL:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_ALL</code></span></p></td> |
| <td>beyond <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-DEFAULT:CAPS"><code class="literal">G_NORMALIZE_DEFAULT</code></a> 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><p><a name="G-NORMALIZE-NFKD:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_NFKD</code></span></p></td> |
| <td>another name for <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL:CAPS"><code class="literal">G_NORMALIZE_ALL</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-ALL-COMPOSE:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_ALL_COMPOSE</code></span></p></td> |
| <td>like <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL:CAPS"><code class="literal">G_NORMALIZE_ALL</code></a>, but with composed |
| forms rather than a maximally decomposed form. |
| </td> |
| </tr> |
| <tr> |
| <td><p><a name="G-NORMALIZE-NFKC:CAPS"></a><span class="term"><code class="literal">G_NORMALIZE_NFKC</code></span></p></td> |
| <td>another name for <a class="link" href="glib-Unicode-Manipulation.html#G-NORMALIZE-ALL-COMPOSE:CAPS"><code class="literal">G_NORMALIZE_ALL_COMPOSE</code></a>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_collate ()"> |
| <a name="g-utf8-collate"></a><h3>g_utf8_collate ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_utf8_collate (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str1</code></em>, |
| <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str2</code></em>);</pre> |
| <p> |
| Compares two strings for ordering using the linguistically |
| correct rules for the <a class="link" href="glib-running.html#setlocale" title="Locale">current locale</a>. |
| When sorting a large number of strings, it will be significantly |
| faster to obtain collation keys with <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate-key" title="g_utf8_collate_key ()"><code class="function">g_utf8_collate_key()</code></a> and |
| compare the keys with <code class="function">strcmp()</code> when sorting instead of sorting |
| the original strings. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str1</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str2</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> < 0 if <em class="parameter"><code>str1</code></em> compares before <em class="parameter"><code>str2</code></em>, |
| 0 if they compare equal, > 0 if <em class="parameter"><code>str1</code></em> compares after <em class="parameter"><code>str2</code></em>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_collate_key ()"> |
| <a name="g-utf8-collate-key"></a><h3>g_utf8_collate_key ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_collate_key (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</pre> |
| <p> |
| Converts a string into a collation key that can be compared |
| with other collation keys produced by the same function using |
| <code class="function">strcmp()</code>. |
| </p> |
| <p> |
| The results of comparing the collation keys of two strings |
| with <code class="function">strcmp()</code> will always be the same as comparing the two |
| original keys with <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-collate" title="g_utf8_collate ()"><code class="function">g_utf8_collate()</code></a>. |
| </p> |
| <p> |
| Note that this function depends on the |
| <a class="link" href="glib-running.html#setlocale" title="Locale">current locale</a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string. This string should |
| be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when you are done with it. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_collate_key_for_filename ()"> |
| <a name="g-utf8-collate-key-for-filename"></a><h3>g_utf8_collate_key_for_filename ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_utf8_collate_key_for_filename (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</pre> |
| <p> |
| Converts a string into a collation key that can be compared |
| with other collation keys produced by the same function using <code class="function">strcmp()</code>. |
| </p> |
| <p> |
| In order to sort filenames correctly, this function treats the dot '.' |
| as a special case. Most dictionary orderings seem to consider it |
| insignificant, thus producing the ordering "event.c" "eventgenerator.c" |
| "event.h" instead of "event.c" "event.h" "eventgenerator.c". Also, we |
| would like to treat numbers intelligently so that "file1" "file10" "file5" |
| is sorted as "file1" "file5" "file10". |
| </p> |
| <p> |
| Note that this function depends on the |
| <a class="link" href="glib-running.html#setlocale" title="Locale">current locale</a>. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>length of <em class="parameter"><code>str</code></em>, in bytes, or -1 if <em class="parameter"><code>str</code></em> is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a newly allocated string. This string should |
| be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when you are done with it. |
| |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| <p class="since">Since 2.8</p> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_to_utf16 ()"> |
| <a name="g-utf8-to-utf16"></a><h3>g_utf8_to_utf16 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="returnvalue">gunichar2</span></a> * g_utf8_to_utf16 (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p> |
| Convert a string from UTF-8 to UTF-16. A 0 character will be |
| added to the result after the converted text. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length (number of bytes) of <em class="parameter"><code>str</code></em> to use. |
| If <em class="parameter"><code>len</code></em> < 0, then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of bytes read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| If <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, then <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</code></a> will be |
| returned in case <em class="parameter"><code>str</code></em> contains a trailing partial |
| character. If an error occurs then the index of the |
| invalid input is stored here. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of <span class="type">gunichar2</span> written, |
| or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| The value stored here does not include the trailing 0. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UTF-16 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_to_ucs4 ()"> |
| <a name="g-utf8-to-ucs4"></a><h3>g_utf8_to_ucs4 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * g_utf8_to_ucs4 (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>str</code></em> to use, in bytes. If <em class="parameter"><code>len</code></em> < 0, |
| then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of bytes read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| If <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, then <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</code></a> will be |
| returned in case <em class="parameter"><code>str</code></em> contains a trailing partial |
| character. If an error occurs then the index of the |
| invalid input is stored here. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of characters written or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| The value here stored does not include the trailing 0 |
| character. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UCS-4 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf8_to_ucs4_fast ()"> |
| <a name="g-utf8-to-ucs4-fast"></a><h3>g_utf8_to_ucs4_fast ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * g_utf8_to_ucs4_fast (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>);</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 class="link" href="glib-Unicode-Manipulation.html#g-utf8-to-ucs4" title="g_utf8_to_ucs4 ()"><code class="function">g_utf8_to_ucs4()</code></a> |
| but does no error checking on the input. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-8 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length of <em class="parameter"><code>str</code></em> to use, in bytes. If <em class="parameter"><code>len</code></em> < 0, |
| then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store the number of characters in the |
| result, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UCS-4 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf16_to_ucs4 ()"> |
| <a name="g-utf16-to-ucs4"></a><h3>g_utf16_to_ucs4 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="returnvalue">gunichar</span></a> * g_utf16_to_ucs4 (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="type">gunichar2</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p> |
| Convert a string from UTF-16 to UCS-4. The result will be |
| nul-terminated. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-16 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length (number of <span class="type">gunichar2</span>) of <em class="parameter"><code>str</code></em> to use. |
| If <em class="parameter"><code>len</code></em> < 0, then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of words read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| If <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, then <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</code></a> will be |
| returned in case <em class="parameter"><code>str</code></em> contains a trailing partial |
| character. If an error occurs then the index of the |
| invalid input is stored here. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of characters written, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| The value stored here does not include the trailing |
| 0 character. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UCS-4 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_utf16_to_utf8 ()"> |
| <a name="g-utf16-to-utf8"></a><h3>g_utf16_to_utf8 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_utf16_to_utf8 (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="type">gunichar2</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p> |
| Convert a string from UTF-16 to UTF-8. The result will be |
| terminated with a 0 byte. |
| </p> |
| <p> |
| Note that the input is expected to be already in native endianness, |
| an initial byte-order-mark character is not handled specially. |
| <a class="link" href="glib-Character-Set-Conversion.html#g-convert" title="g_convert ()"><code class="function">g_convert()</code></a> can be used to convert a byte buffer of UTF-16 data of |
| ambiguous endianess. |
| </p> |
| <p> |
| Further note that this function does not validate the result |
| string; it may e.g. include embedded NUL characters. The only |
| validation done by this function is to ensure that the input can |
| be correctly interpreted as UTF-16, i.e. it doesn't contain |
| things unpaired surrogates. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UTF-16 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length (number of <span class="type">gunichar2</span>) of <em class="parameter"><code>str</code></em> to use. |
| If <em class="parameter"><code>len</code></em> < 0, then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of words read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| If <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, then <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-PARTIAL-INPUT:CAPS"><code class="literal">G_CONVERT_ERROR_PARTIAL_INPUT</code></a> will be |
| returned in case <em class="parameter"><code>str</code></em> contains a trailing partial |
| character. If an error occurs then the index of the |
| invalid input is stored here. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of bytes written, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| The value stored here does not include the trailing |
| 0 byte. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UTF-8 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_ucs4_to_utf16 ()"> |
| <a name="g-ucs4-to-utf16"></a><h3>g_ucs4_to_utf16 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Unicode-Manipulation.html#gunichar2" title="gunichar2"><span class="returnvalue">gunichar2</span></a> * g_ucs4_to_utf16 (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p> |
| Convert a string from UCS-4 to UTF-16. A 0 character will be |
| added to the result after the converted text. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UCS-4 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length (number of characters) of <em class="parameter"><code>str</code></em> to use. |
| If <em class="parameter"><code>len</code></em> < 0, then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of bytes read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| If an error occurs then the index of the invalid input |
| is stored here. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of <span class="type">gunichar2</span> |
| written, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. The value stored here does not |
| include the trailing 0. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UTF-16 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_ucs4_to_utf8 ()"> |
| <a name="g-ucs4-to-utf8"></a><h3>g_ucs4_to_utf8 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* g_ucs4_to_utf8 (<em class="parameter"><code>const <a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> *str</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> len</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_read</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a> *items_written</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> **error</code></em>);</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> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> |
| <td>a UCS-4 encoded string |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> |
| <td>the maximum length (number of characters) of <em class="parameter"><code>str</code></em> to use. |
| If <em class="parameter"><code>len</code></em> < 0, then the string is nul-terminated. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_read</code></em> :</span></p></td> |
| <td>location to store number of characters read, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>items_written</code></em> :</span></p></td> |
| <td>location to store number of bytes written or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. |
| The value here stored does not include the trailing 0 |
| byte. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> |
| <td>location to store the error occuring, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore |
| errors. Any of the errors in <a class="link" href="glib-Character-Set-Conversion.html#GConvertError" title="enum GConvertError"><span class="type">GConvertError</span></a> other than |
| <a class="link" href="glib-Character-Set-Conversion.html#G-CONVERT-ERROR-NO-CONVERSION:CAPS"><code class="literal">G_CONVERT_ERROR_NO_CONVERSION</code></a> may occur. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> a pointer to a newly allocated UTF-8 string. |
| This value must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. If an |
| error occurs, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> will be returned and |
| <em class="parameter"><code>error</code></em> set. In that case, <em class="parameter"><code>items_read</code></em> will be |
| set to the position of the first invalid input |
| character. |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2" title="g_unichar_to_utf8 ()"> |
| <a name="g-unichar-to-utf8"></a><h3>g_unichar_to_utf8 ()</h3> |
| <pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_unichar_to_utf8 (<em class="parameter"><code><a class="link" href="glib-Unicode-Manipulation.html#gunichar" title="gunichar"><span class="type">gunichar</span></a> c</code></em>, |
| <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *outbuf</code></em>);</pre> |
| <p> |
| Converts a single character to UTF-8. |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td> |
| <td>a Unicode character code |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><em class="parameter"><code>outbuf</code></em> :</span></p></td> |
| <td>output buffer, must have at least 6 bytes of space. |
| If <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the length will be computed and returned |
| and nothing will be written to <em class="parameter"><code>outbuf</code></em>. |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> |
| <td> number of bytes written |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <div class="refsect1" title="See Also"> |
| <a name="glib-Unicode-Manipulation.see-also"></a><h2>See Also</h2> |
| <p> |
| </p> |
| <div class="variablelist"><table border="0"> |
| <col align="left" valign="top"> |
| <tbody><tr> |
| <td><p><span class="term"><a class="link" href="glib-Character-Set-Conversion.html#g-locale-to-utf8" title="g_locale_to_utf8 ()"><code class="function">g_locale_to_utf8()</code></a>, <a class="link" href="glib-Character-Set-Conversion.html#g-locale-from-utf8" title="g_locale_from_utf8 ()"><code class="function">g_locale_from_utf8()</code></a></span></p></td> |
| <td><p> |
| Convenience functions for converting between UTF-8 and the locale encoding. |
| </p></td> |
| </tr></tbody> |
| </table></div> |
| <p> |
| </p> |
| </div> |
| <div class="footnotes"> |
| <br><hr width="100" align="left"> |
| <div class="footnote"><em class="firstterm"><sup>[<a name="ftn.utf16_surrogate_pairs" href="#utf16_surrogate_pairs" class="firstterm">3</a>] </sup>surrogate pairs</em></div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr> |
| Generated by GTK-Doc V1.14</div> |
| </body> |
| </html> |