⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unicode.sgml

📁 GLib是GTK+和GNOME工程的基础底层核心程序库
💻 SGML
📖 第 1 页 / 共 5 页
字号:
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-unichar-digit-value">g_unichar_digit_value ()</title><programlisting><link linkend="gint">gint</link>        g_unichar_digit_value           (<link linkend="gunichar">gunichar</link> c);</programlisting><para>Determines the numeric value of a character as a decimaldigit.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>c</parameter>&nbsp;:</entry><entry> a Unicode character</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> If <parameter>c</parameter> is a decimal digit (according to<link linkend="g-unichar-isdigit">g_unichar_isdigit</link>()), its numeric value. Otherwise, -1.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-unichar-xdigit-value">g_unichar_xdigit_value ()</title><programlisting><link linkend="gint">gint</link>        g_unichar_xdigit_value          (<link linkend="gunichar">gunichar</link> c);</programlisting><para>Determines the numeric value of a character as a hexidecimaldigit.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>c</parameter>&nbsp;:</entry><entry> a Unicode character</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> If <parameter>c</parameter> is a hex digit (according to<link linkend="g-unichar-isxdigit">g_unichar_isxdigit</link>()), its numeric value. Otherwise, -1.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GUnicodeType">enum GUnicodeType</title><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;</programlisting><para>These are the possible character classifications.See <ulink url="http://www.unicode.org/Public/UNIDATA/UnicodeData.html">http://www.unicode.org/Public/UNIDATA/UnicodeData.html</ulink>.</para></refsect2><refsect2><title><anchor id="g-unichar-type">g_unichar_type ()</title><programlisting><link linkend="GUnicodeType">GUnicodeType</link> g_unichar_type                 (<link linkend="gunichar">gunichar</link> c);</programlisting><para>Classifies a Unicode character by type.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>c</parameter>&nbsp;:</entry><entry> a Unicode character</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the type of the character.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GUnicodeBreakType">enum GUnicodeBreakType</title><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} GUnicodeBreakType;</programlisting><para>These are the possible line break classifications.See <ulink url="http://www.unicode.org/unicode/reports/tr14/">http://www.unicode.org/unicode/reports/tr14/</ulink>.</para></refsect2><refsect2><title><anchor id="g-unichar-break-type">g_unichar_break_type ()</title><programlisting><link linkend="GUnicodeBreakType">GUnicodeBreakType</link> g_unichar_break_type      (<link linkend="gunichar">gunichar</link> c);</programlisting><para>Determines the break type of <parameter>c</parameter>. <parameter>c</parameter> should be a Unicode character(to derive a character from UTF-8 encoded text, use<link linkend="g-utf8-get-char">g_utf8_get_char</link>()). The break type is used to find word and linebreaks ("text boundaries"), Pango implements the Unicode boundaryresolution algorithms and normally you would use a function suchas <link linkend="pango-break">pango_break</link>() instead of caring about break types yourself.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>c</parameter>&nbsp;:</entry><entry> a Unicode character</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the break type of <parameter>c</parameter></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-unicode-canonical-ordering">g_unicode_canonical_ordering ()</title><programlisting>void        g_unicode_canonical_ordering    (<link linkend="gunichar">gunichar</link> *string,                                             <link linkend="gsize">gsize</link> len);</programlisting><para>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.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>string</parameter>&nbsp;:</entry><entry> a UCS-4 encoded string.</entry></row><row><entry align="right"><parameter>len</parameter>&nbsp;:</entry><entry> the maximum length of <parameter>string</parameter> to use.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-unicode-canonical-decomposition">g_unicode_canonical_decomposition ()</title><programlisting><link linkend="gunichar">gunichar</link>*   g_unicode_canonical_decomposition                                            (<link linkend="gunichar">gunichar</link> ch,                                             <link linkend="gsize">gsize</link> *result_len);</programlisting><para>Computes the canonical decomposition of a Unicode character.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>ch</parameter>&nbsp;:</entry><entry> a Unicode character.</entry></row><row><entry align="right"><parameter>result_len</parameter>&nbsp;:</entry><entry> location to store the length of the return value.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a newly allocated string of Unicode characters.  <parameter>result_len</parameter> is set to the resulting length of the string.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-utf8-next-char">g_utf8_next_char()</title><programlisting>#define     g_utf8_next_char(p)</programlisting><para>Skips to the next character in a UTF-8 string. The string must bevalid; this macro is as fast as possible, and has no error-checking.You would use this macro to iterate over a string character bycharacter. The macro returns the start of the next UTF-8 character.Before using this macro, use <link linkend="g-utf8-validate">g_utf8_validate</link>() to validate stringsthat may contain invalid UTF-8.</para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>p</parameter>&nbsp;:</entry><entry>Pointer to the start of a valid UTF-8 character.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-utf8-get-char">g_utf8_get_char ()</title><programlisting><link linkend="gunichar">gunichar</link>    g_utf8_get_char                 (const <link linkend="gchar">gchar</link> *p);</programlisting><para>Converts a sequence of bytes encoded as UTF-8 to a Unicode character.If <parameter>p</parameter> does not point to a valid UTF-8 encoded character, results areundefined. If you are not sure that the bytes are completevalid Unicode characters, you should use <link linkend="g-utf8-get-char-validated">g_utf8_get_char_validated</link>()instead.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>p</parameter>&nbsp;:</entry><entry> a pointer to Unicode character encoded as UTF-8</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the resulting character</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="g-utf8-get-char-validated">g_utf8_get_char_validated ()</title><programlisting><link linkend="gunichar">gunichar</link>    g_utf8_get_char_validated       (const  <link linkend="gchar">gchar</link> *p,                                             <link linkend="gssize">gssize</link> max_len);</programlisting><para>Convert a sequence of bytes encoded as UTF-8 to a Unicode character.This function checks for incomplete characters, for invalid characterssuch as characters that are out of the range of Unicode, and foroverlong encodings of valid characters.</para><para>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -