gunicode.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. /* gunicode.h - Unicode manipulation functions
  2. *
  3. * Copyright (C) 1999, 2000 Tom Tromey
  4. * Copyright 2000, 2005 Red Hat, Inc.
  5. *
  6. * The Gnome Library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License as
  8. * published by the Free Software Foundation; either version 2 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * The Gnome Library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with the Gnome Library; see the file COPYING.LIB. If not,
  18. * see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __G_UNICODE_H__
  21. #define __G_UNICODE_H__
  22. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  23. #error "Only <glib.h> can be included directly."
  24. #endif
  25. #include <glib/gerror.h>
  26. #include <glib/gtypes.h>
  27. G_BEGIN_DECLS
  28. /**
  29. * gunichar:
  30. *
  31. * A type which can hold any UTF-32 or UCS-4 character code,
  32. * also known as a Unicode code point.
  33. *
  34. * If you want to produce the UTF-8 representation of a #gunichar,
  35. * use g_ucs4_to_utf8(). See also g_utf8_to_ucs4() for the reverse
  36. * process.
  37. *
  38. * To print/scan values of this type as integer, use
  39. * %G_GINT32_MODIFIER and/or %G_GUINT32_FORMAT.
  40. *
  41. * The notation to express a Unicode code point in running text is
  42. * as a hexadecimal number with four to six digits and uppercase
  43. * letters, prefixed by the string "U+". Leading zeros are omitted,
  44. * unless the code point would have fewer than four hexadecimal digits.
  45. * For example, "U+0041 LATIN CAPITAL LETTER A". To print a code point
  46. * in the U+-notation, use the format string "U+\%04"G_GINT32_FORMAT"X".
  47. * To scan, use the format string "U+\%06"G_GINT32_FORMAT"X".
  48. *
  49. * |[
  50. * gunichar c;
  51. * sscanf ("U+0041", "U+%06"G_GINT32_FORMAT"X", &amp;c)
  52. * g_print ("Read U+%04"G_GINT32_FORMAT"X", c);
  53. * ]|
  54. */
  55. typedef guint32 gunichar;
  56. /**
  57. * gunichar2:
  58. *
  59. * A type which can hold any UTF-16 code
  60. * point<footnote id="utf16_surrogate_pairs">UTF-16 also has so called
  61. * <firstterm>surrogate pairs</firstterm> to encode characters beyond
  62. * the BMP as pairs of 16bit numbers. Surrogate pairs cannot be stored
  63. * in a single gunichar2 field, but all GLib functions accepting gunichar2
  64. * arrays will correctly interpret surrogate pairs.</footnote>.
  65. *
  66. * To print/scan values of this type to/from text you need to convert
  67. * to/from UTF-8, using g_utf16_to_utf8()/g_utf8_to_utf16().
  68. *
  69. * To print/scan values of this type as integer, use
  70. * %G_GINT16_MODIFIER and/or %G_GUINT16_FORMAT.
  71. */
  72. typedef guint16 gunichar2;
  73. /**
  74. * GUnicodeType:
  75. * @G_UNICODE_CONTROL: General category "Other, Control" (Cc)
  76. * @G_UNICODE_FORMAT: General category "Other, Format" (Cf)
  77. * @G_UNICODE_UNASSIGNED: General category "Other, Not Assigned" (Cn)
  78. * @G_UNICODE_PRIVATE_USE: General category "Other, Private Use" (Co)
  79. * @G_UNICODE_SURROGATE: General category "Other, Surrogate" (Cs)
  80. * @G_UNICODE_LOWERCASE_LETTER: General category "Letter, Lowercase" (Ll)
  81. * @G_UNICODE_MODIFIER_LETTER: General category "Letter, Modifier" (Lm)
  82. * @G_UNICODE_OTHER_LETTER: General category "Letter, Other" (Lo)
  83. * @G_UNICODE_TITLECASE_LETTER: General category "Letter, Titlecase" (Lt)
  84. * @G_UNICODE_UPPERCASE_LETTER: General category "Letter, Uppercase" (Lu)
  85. * @G_UNICODE_SPACING_MARK: General category "Mark, Spacing" (Mc)
  86. * @G_UNICODE_ENCLOSING_MARK: General category "Mark, Enclosing" (Me)
  87. * @G_UNICODE_NON_SPACING_MARK: General category "Mark, Nonspacing" (Mn)
  88. * @G_UNICODE_DECIMAL_NUMBER: General category "Number, Decimal Digit" (Nd)
  89. * @G_UNICODE_LETTER_NUMBER: General category "Number, Letter" (Nl)
  90. * @G_UNICODE_OTHER_NUMBER: General category "Number, Other" (No)
  91. * @G_UNICODE_CONNECT_PUNCTUATION: General category "Punctuation, Connector" (Pc)
  92. * @G_UNICODE_DASH_PUNCTUATION: General category "Punctuation, Dash" (Pd)
  93. * @G_UNICODE_CLOSE_PUNCTUATION: General category "Punctuation, Close" (Pe)
  94. * @G_UNICODE_FINAL_PUNCTUATION: General category "Punctuation, Final quote" (Pf)
  95. * @G_UNICODE_INITIAL_PUNCTUATION: General category "Punctuation, Initial quote" (Pi)
  96. * @G_UNICODE_OTHER_PUNCTUATION: General category "Punctuation, Other" (Po)
  97. * @G_UNICODE_OPEN_PUNCTUATION: General category "Punctuation, Open" (Ps)
  98. * @G_UNICODE_CURRENCY_SYMBOL: General category "Symbol, Currency" (Sc)
  99. * @G_UNICODE_MODIFIER_SYMBOL: General category "Symbol, Modifier" (Sk)
  100. * @G_UNICODE_MATH_SYMBOL: General category "Symbol, Math" (Sm)
  101. * @G_UNICODE_OTHER_SYMBOL: General category "Symbol, Other" (So)
  102. * @G_UNICODE_LINE_SEPARATOR: General category "Separator, Line" (Zl)
  103. * @G_UNICODE_PARAGRAPH_SEPARATOR: General category "Separator, Paragraph" (Zp)
  104. * @G_UNICODE_SPACE_SEPARATOR: General category "Separator, Space" (Zs)
  105. *
  106. * These are the possible character classifications from the
  107. * Unicode specification.
  108. * See <ulink url="http://www.unicode.org/Public/UNIDATA/UnicodeData.html">http://www.unicode.org/Public/UNIDATA/UnicodeData.html</ulink>.
  109. */
  110. typedef enum
  111. {
  112. G_UNICODE_CONTROL,
  113. G_UNICODE_FORMAT,
  114. G_UNICODE_UNASSIGNED,
  115. G_UNICODE_PRIVATE_USE,
  116. G_UNICODE_SURROGATE,
  117. G_UNICODE_LOWERCASE_LETTER,
  118. G_UNICODE_MODIFIER_LETTER,
  119. G_UNICODE_OTHER_LETTER,
  120. G_UNICODE_TITLECASE_LETTER,
  121. G_UNICODE_UPPERCASE_LETTER,
  122. G_UNICODE_SPACING_MARK,
  123. G_UNICODE_ENCLOSING_MARK,
  124. G_UNICODE_NON_SPACING_MARK,
  125. G_UNICODE_DECIMAL_NUMBER,
  126. G_UNICODE_LETTER_NUMBER,
  127. G_UNICODE_OTHER_NUMBER,
  128. G_UNICODE_CONNECT_PUNCTUATION,
  129. G_UNICODE_DASH_PUNCTUATION,
  130. G_UNICODE_CLOSE_PUNCTUATION,
  131. G_UNICODE_FINAL_PUNCTUATION,
  132. G_UNICODE_INITIAL_PUNCTUATION,
  133. G_UNICODE_OTHER_PUNCTUATION,
  134. G_UNICODE_OPEN_PUNCTUATION,
  135. G_UNICODE_CURRENCY_SYMBOL,
  136. G_UNICODE_MODIFIER_SYMBOL,
  137. G_UNICODE_MATH_SYMBOL,
  138. G_UNICODE_OTHER_SYMBOL,
  139. G_UNICODE_LINE_SEPARATOR,
  140. G_UNICODE_PARAGRAPH_SEPARATOR,
  141. G_UNICODE_SPACE_SEPARATOR
  142. } GUnicodeType;
  143. /**
  144. * G_UNICODE_COMBINING_MARK:
  145. *
  146. * Older name for %G_UNICODE_SPACING_MARK.
  147. *
  148. * Deprecated: 2.30: Use %G_UNICODE_SPACING_MARK.
  149. */
  150. #ifndef G_DISABLE_DEPRECATED
  151. #define G_UNICODE_COMBINING_MARK G_UNICODE_SPACING_MARK
  152. #endif
  153. /**
  154. * GUnicodeBreakType:
  155. * @G_UNICODE_BREAK_MANDATORY: Mandatory Break (BK)
  156. * @G_UNICODE_BREAK_CARRIAGE_RETURN: Carriage Return (CR)
  157. * @G_UNICODE_BREAK_LINE_FEED: Line Feed (LF)
  158. * @G_UNICODE_BREAK_COMBINING_MARK: Attached Characters and Combining Marks (CM)
  159. * @G_UNICODE_BREAK_SURROGATE: Surrogates (SG)
  160. * @G_UNICODE_BREAK_ZERO_WIDTH_SPACE: Zero Width Space (ZW)
  161. * @G_UNICODE_BREAK_INSEPARABLE: Inseparable (IN)
  162. * @G_UNICODE_BREAK_NON_BREAKING_GLUE: Non-breaking ("Glue") (GL)
  163. * @G_UNICODE_BREAK_CONTINGENT: Contingent Break Opportunity (CB)
  164. * @G_UNICODE_BREAK_SPACE: Space (SP)
  165. * @G_UNICODE_BREAK_AFTER: Break Opportunity After (BA)
  166. * @G_UNICODE_BREAK_BEFORE: Break Opportunity Before (BB)
  167. * @G_UNICODE_BREAK_BEFORE_AND_AFTER: Break Opportunity Before and After (B2)
  168. * @G_UNICODE_BREAK_HYPHEN: Hyphen (HY)
  169. * @G_UNICODE_BREAK_NON_STARTER: Nonstarter (NS)
  170. * @G_UNICODE_BREAK_OPEN_PUNCTUATION: Opening Punctuation (OP)
  171. * @G_UNICODE_BREAK_CLOSE_PUNCTUATION: Closing Punctuation (CL)
  172. * @G_UNICODE_BREAK_QUOTATION: Ambiguous Quotation (QU)
  173. * @G_UNICODE_BREAK_EXCLAMATION: Exclamation/Interrogation (EX)
  174. * @G_UNICODE_BREAK_IDEOGRAPHIC: Ideographic (ID)
  175. * @G_UNICODE_BREAK_NUMERIC: Numeric (NU)
  176. * @G_UNICODE_BREAK_INFIX_SEPARATOR: Infix Separator (Numeric) (IS)
  177. * @G_UNICODE_BREAK_SYMBOL: Symbols Allowing Break After (SY)
  178. * @G_UNICODE_BREAK_ALPHABETIC: Ordinary Alphabetic and Symbol Characters (AL)
  179. * @G_UNICODE_BREAK_PREFIX: Prefix (Numeric) (PR)
  180. * @G_UNICODE_BREAK_POSTFIX: Postfix (Numeric) (PO)
  181. * @G_UNICODE_BREAK_COMPLEX_CONTEXT: Complex Content Dependent (South East Asian) (SA)
  182. * @G_UNICODE_BREAK_AMBIGUOUS: Ambiguous (Alphabetic or Ideographic) (AI)
  183. * @G_UNICODE_BREAK_UNKNOWN: Unknown (XX)
  184. * @G_UNICODE_BREAK_NEXT_LINE: Next Line (NL)
  185. * @G_UNICODE_BREAK_WORD_JOINER: Word Joiner (WJ)
  186. * @G_UNICODE_BREAK_HANGUL_L_JAMO: Hangul L Jamo (JL)
  187. * @G_UNICODE_BREAK_HANGUL_V_JAMO: Hangul V Jamo (JV)
  188. * @G_UNICODE_BREAK_HANGUL_T_JAMO: Hangul T Jamo (JT)
  189. * @G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: Hangul LV Syllable (H2)
  190. * @G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: Hangul LVT Syllable (H3)
  191. * @G_UNICODE_BREAK_CLOSE_PARANTHESIS: Closing Parenthesis (CP). Since 2.28
  192. * @G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: Conditional Japanese Starter (CJ). Since: 2.32
  193. * @G_UNICODE_BREAK_HEBREW_LETTER: Hebrew Letter (HL). Since: 2.32
  194. * @G_UNICODE_BREAK_REGIONAL_INDICATOR: Regional Indicator (RI). Since: 2.36
  195. *
  196. * These are the possible line break classifications.
  197. *
  198. * Since new unicode versions may add new types here, applications should be ready
  199. * to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
  200. *
  201. * See <ulink url="http://www.unicode.org/unicode/reports/tr14/">http://www.unicode.org/unicode/reports/tr14/</ulink>.
  202. */
  203. typedef enum
  204. {
  205. G_UNICODE_BREAK_MANDATORY,
  206. G_UNICODE_BREAK_CARRIAGE_RETURN,
  207. G_UNICODE_BREAK_LINE_FEED,
  208. G_UNICODE_BREAK_COMBINING_MARK,
  209. G_UNICODE_BREAK_SURROGATE,
  210. G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
  211. G_UNICODE_BREAK_INSEPARABLE,
  212. G_UNICODE_BREAK_NON_BREAKING_GLUE,
  213. G_UNICODE_BREAK_CONTINGENT,
  214. G_UNICODE_BREAK_SPACE,
  215. G_UNICODE_BREAK_AFTER,
  216. G_UNICODE_BREAK_BEFORE,
  217. G_UNICODE_BREAK_BEFORE_AND_AFTER,
  218. G_UNICODE_BREAK_HYPHEN,
  219. G_UNICODE_BREAK_NON_STARTER,
  220. G_UNICODE_BREAK_OPEN_PUNCTUATION,
  221. G_UNICODE_BREAK_CLOSE_PUNCTUATION,
  222. G_UNICODE_BREAK_QUOTATION,
  223. G_UNICODE_BREAK_EXCLAMATION,
  224. G_UNICODE_BREAK_IDEOGRAPHIC,
  225. G_UNICODE_BREAK_NUMERIC,
  226. G_UNICODE_BREAK_INFIX_SEPARATOR,
  227. G_UNICODE_BREAK_SYMBOL,
  228. G_UNICODE_BREAK_ALPHABETIC,
  229. G_UNICODE_BREAK_PREFIX,
  230. G_UNICODE_BREAK_POSTFIX,
  231. G_UNICODE_BREAK_COMPLEX_CONTEXT,
  232. G_UNICODE_BREAK_AMBIGUOUS,
  233. G_UNICODE_BREAK_UNKNOWN,
  234. G_UNICODE_BREAK_NEXT_LINE,
  235. G_UNICODE_BREAK_WORD_JOINER,
  236. G_UNICODE_BREAK_HANGUL_L_JAMO,
  237. G_UNICODE_BREAK_HANGUL_V_JAMO,
  238. G_UNICODE_BREAK_HANGUL_T_JAMO,
  239. G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
  240. G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE,
  241. G_UNICODE_BREAK_CLOSE_PARANTHESIS,
  242. G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER,
  243. G_UNICODE_BREAK_HEBREW_LETTER,
  244. G_UNICODE_BREAK_REGIONAL_INDICATOR
  245. } GUnicodeBreakType;
  246. /**
  247. * GUnicodeScript:
  248. * @G_UNICODE_SCRIPT_INVALID_CODE:
  249. * a value never returned from g_unichar_get_script()
  250. * @G_UNICODE_SCRIPT_COMMON: a character used by multiple different scripts
  251. * @G_UNICODE_SCRIPT_INHERITED: a mark glyph that takes its script from the
  252. * i base glyph to which it is attached
  253. * @G_UNICODE_SCRIPT_ARABIC: Arabic
  254. * @G_UNICODE_SCRIPT_ARMENIAN: Armenian
  255. * @G_UNICODE_SCRIPT_BENGALI: Bengali
  256. * @G_UNICODE_SCRIPT_BOPOMOFO: Bopomofo
  257. * @G_UNICODE_SCRIPT_CHEROKEE: Cherokee
  258. * @G_UNICODE_SCRIPT_COPTIC: Coptic
  259. * @G_UNICODE_SCRIPT_CYRILLIC: Cyrillic
  260. * @G_UNICODE_SCRIPT_DESERET: Deseret
  261. * @G_UNICODE_SCRIPT_DEVANAGARI: Devanagari
  262. * @G_UNICODE_SCRIPT_ETHIOPIC: Ethiopic
  263. * @G_UNICODE_SCRIPT_GEORGIAN: Georgian
  264. * @G_UNICODE_SCRIPT_GOTHIC: Gothic
  265. * @G_UNICODE_SCRIPT_GREEK: Greek
  266. * @G_UNICODE_SCRIPT_GUJARATI: Gujarati
  267. * @G_UNICODE_SCRIPT_GURMUKHI: Gurmukhi
  268. * @G_UNICODE_SCRIPT_HAN: Han
  269. * @G_UNICODE_SCRIPT_HANGUL: Hangul
  270. * @G_UNICODE_SCRIPT_HEBREW: Hebrew
  271. * @G_UNICODE_SCRIPT_HIRAGANA: Hiragana
  272. * @G_UNICODE_SCRIPT_KANNADA: Kannada
  273. * @G_UNICODE_SCRIPT_KATAKANA: Katakana
  274. * @G_UNICODE_SCRIPT_KHMER: Khmer
  275. * @G_UNICODE_SCRIPT_LAO: Lao
  276. * @G_UNICODE_SCRIPT_LATIN: Latin
  277. * @G_UNICODE_SCRIPT_MALAYALAM: Malayalam
  278. * @G_UNICODE_SCRIPT_MONGOLIAN: Mongolian
  279. * @G_UNICODE_SCRIPT_MYANMAR: Myanmar
  280. * @G_UNICODE_SCRIPT_OGHAM: Ogham
  281. * @G_UNICODE_SCRIPT_OLD_ITALIC: Old Italic
  282. * @G_UNICODE_SCRIPT_ORIYA: Oriya
  283. * @G_UNICODE_SCRIPT_RUNIC: Runic
  284. * @G_UNICODE_SCRIPT_SINHALA: Sinhala
  285. * @G_UNICODE_SCRIPT_SYRIAC: Syriac
  286. * @G_UNICODE_SCRIPT_TAMIL: Tamil
  287. * @G_UNICODE_SCRIPT_TELUGU: Telugu
  288. * @G_UNICODE_SCRIPT_THAANA: Thaana
  289. * @G_UNICODE_SCRIPT_THAI: Thai
  290. * @G_UNICODE_SCRIPT_TIBETAN: Tibetan
  291. * @G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL:
  292. * Canadian Aboriginal
  293. * @G_UNICODE_SCRIPT_YI: Yi
  294. * @G_UNICODE_SCRIPT_TAGALOG: Tagalog
  295. * @G_UNICODE_SCRIPT_HANUNOO: Hanunoo
  296. * @G_UNICODE_SCRIPT_BUHID: Buhid
  297. * @G_UNICODE_SCRIPT_TAGBANWA: Tagbanwa
  298. * @G_UNICODE_SCRIPT_BRAILLE: Braille
  299. * @G_UNICODE_SCRIPT_CYPRIOT: Cypriot
  300. * @G_UNICODE_SCRIPT_LIMBU: Limbu
  301. * @G_UNICODE_SCRIPT_OSMANYA: Osmanya
  302. * @G_UNICODE_SCRIPT_SHAVIAN: Shavian
  303. * @G_UNICODE_SCRIPT_LINEAR_B: Linear B
  304. * @G_UNICODE_SCRIPT_TAI_LE: Tai Le
  305. * @G_UNICODE_SCRIPT_UGARITIC: Ugaritic
  306. * @G_UNICODE_SCRIPT_NEW_TAI_LUE:
  307. * New Tai Lue
  308. * @G_UNICODE_SCRIPT_BUGINESE: Buginese
  309. * @G_UNICODE_SCRIPT_GLAGOLITIC: Glagolitic
  310. * @G_UNICODE_SCRIPT_TIFINAGH: Tifinagh
  311. * @G_UNICODE_SCRIPT_SYLOTI_NAGRI:
  312. * Syloti Nagri
  313. * @G_UNICODE_SCRIPT_OLD_PERSIAN:
  314. * Old Persian
  315. * @G_UNICODE_SCRIPT_KHAROSHTHI: Kharoshthi
  316. * @G_UNICODE_SCRIPT_UNKNOWN: an unassigned code point
  317. * @G_UNICODE_SCRIPT_BALINESE: Balinese
  318. * @G_UNICODE_SCRIPT_CUNEIFORM: Cuneiform
  319. * @G_UNICODE_SCRIPT_PHOENICIAN: Phoenician
  320. * @G_UNICODE_SCRIPT_PHAGS_PA: Phags-pa
  321. * @G_UNICODE_SCRIPT_NKO: N'Ko
  322. * @G_UNICODE_SCRIPT_KAYAH_LI: Kayah Li. Since 2.16.3
  323. * @G_UNICODE_SCRIPT_LEPCHA: Lepcha. Since 2.16.3
  324. * @G_UNICODE_SCRIPT_REJANG: Rejang. Since 2.16.3
  325. * @G_UNICODE_SCRIPT_SUNDANESE: Sundanese. Since 2.16.3
  326. * @G_UNICODE_SCRIPT_SAURASHTRA: Saurashtra. Since 2.16.3
  327. * @G_UNICODE_SCRIPT_CHAM: Cham. Since 2.16.3
  328. * @G_UNICODE_SCRIPT_OL_CHIKI: Ol Chiki. Since 2.16.3
  329. * @G_UNICODE_SCRIPT_VAI: Vai. Since 2.16.3
  330. * @G_UNICODE_SCRIPT_CARIAN: Carian. Since 2.16.3
  331. * @G_UNICODE_SCRIPT_LYCIAN: Lycian. Since 2.16.3
  332. * @G_UNICODE_SCRIPT_LYDIAN: Lydian. Since 2.16.3
  333. * @G_UNICODE_SCRIPT_AVESTAN: Avestan. Since 2.26
  334. * @G_UNICODE_SCRIPT_BAMUM: Bamum. Since 2.26
  335. * @G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS:
  336. * Egyptian Hieroglpyhs. Since 2.26
  337. * @G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC:
  338. * Imperial Aramaic. Since 2.26
  339. * @G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI:
  340. * Inscriptional Pahlavi. Since 2.26
  341. * @G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN:
  342. * Inscriptional Parthian. Since 2.26
  343. * @G_UNICODE_SCRIPT_JAVANESE: Javanese. Since 2.26
  344. * @G_UNICODE_SCRIPT_KAITHI: Kaithi. Since 2.26
  345. * @G_UNICODE_SCRIPT_LISU: Lisu. Since 2.26
  346. * @G_UNICODE_SCRIPT_MEETEI_MAYEK:
  347. * Meetei Mayek. Since 2.26
  348. * @G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN:
  349. * Old South Arabian. Since 2.26
  350. * @G_UNICODE_SCRIPT_OLD_TURKIC: Old Turkic. Since 2.28
  351. * @G_UNICODE_SCRIPT_SAMARITAN: Samaritan. Since 2.26
  352. * @G_UNICODE_SCRIPT_TAI_THAM: Tai Tham. Since 2.26
  353. * @G_UNICODE_SCRIPT_TAI_VIET: Tai Viet. Since 2.26
  354. * @G_UNICODE_SCRIPT_BATAK: Batak. Since 2.28
  355. * @G_UNICODE_SCRIPT_BRAHMI: Brahmi. Since 2.28
  356. * @G_UNICODE_SCRIPT_MANDAIC: Mandaic. Since 2.28
  357. * @G_UNICODE_SCRIPT_CHAKMA: Chakma. Since: 2.32
  358. * @G_UNICODE_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 2.32
  359. * @G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS: Meroitic Hieroglyphs. Since: 2.32
  360. * @G_UNICODE_SCRIPT_MIAO: Miao. Since: 2.32
  361. * @G_UNICODE_SCRIPT_SHARADA: Sharada. Since: 2.32
  362. * @G_UNICODE_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 2.32
  363. * @G_UNICODE_SCRIPT_TAKRI: Takri. Since: 2.32
  364. *
  365. * The #GUnicodeScript enumeration identifies different writing
  366. * systems. The values correspond to the names as defined in the
  367. * Unicode standard. The enumeration has been added in GLib 2.14,
  368. * and is interchangeable with #PangoScript.
  369. *
  370. * Note that new types may be added in the future. Applications
  371. * should be ready to handle unknown values.
  372. * See <ulink
  373. * url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex
  374. * #24: Script names</ulink>.
  375. */
  376. typedef enum
  377. { /* ISO 15924 code */
  378. G_UNICODE_SCRIPT_INVALID_CODE = -1,
  379. G_UNICODE_SCRIPT_COMMON = 0, /* Zyyy */
  380. G_UNICODE_SCRIPT_INHERITED, /* Zinh (Qaai) */
  381. G_UNICODE_SCRIPT_ARABIC, /* Arab */
  382. G_UNICODE_SCRIPT_ARMENIAN, /* Armn */
  383. G_UNICODE_SCRIPT_BENGALI, /* Beng */
  384. G_UNICODE_SCRIPT_BOPOMOFO, /* Bopo */
  385. G_UNICODE_SCRIPT_CHEROKEE, /* Cher */
  386. G_UNICODE_SCRIPT_COPTIC, /* Copt (Qaac) */
  387. G_UNICODE_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
  388. G_UNICODE_SCRIPT_DESERET, /* Dsrt */
  389. G_UNICODE_SCRIPT_DEVANAGARI, /* Deva */
  390. G_UNICODE_SCRIPT_ETHIOPIC, /* Ethi */
  391. G_UNICODE_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
  392. G_UNICODE_SCRIPT_GOTHIC, /* Goth */
  393. G_UNICODE_SCRIPT_GREEK, /* Grek */
  394. G_UNICODE_SCRIPT_GUJARATI, /* Gujr */
  395. G_UNICODE_SCRIPT_GURMUKHI, /* Guru */
  396. G_UNICODE_SCRIPT_HAN, /* Hani */
  397. G_UNICODE_SCRIPT_HANGUL, /* Hang */
  398. G_UNICODE_SCRIPT_HEBREW, /* Hebr */
  399. G_UNICODE_SCRIPT_HIRAGANA, /* Hira */
  400. G_UNICODE_SCRIPT_KANNADA, /* Knda */
  401. G_UNICODE_SCRIPT_KATAKANA, /* Kana */
  402. G_UNICODE_SCRIPT_KHMER, /* Khmr */
  403. G_UNICODE_SCRIPT_LAO, /* Laoo */
  404. G_UNICODE_SCRIPT_LATIN, /* Latn (Latf, Latg) */
  405. G_UNICODE_SCRIPT_MALAYALAM, /* Mlym */
  406. G_UNICODE_SCRIPT_MONGOLIAN, /* Mong */
  407. G_UNICODE_SCRIPT_MYANMAR, /* Mymr */
  408. G_UNICODE_SCRIPT_OGHAM, /* Ogam */
  409. G_UNICODE_SCRIPT_OLD_ITALIC, /* Ital */
  410. G_UNICODE_SCRIPT_ORIYA, /* Orya */
  411. G_UNICODE_SCRIPT_RUNIC, /* Runr */
  412. G_UNICODE_SCRIPT_SINHALA, /* Sinh */
  413. G_UNICODE_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
  414. G_UNICODE_SCRIPT_TAMIL, /* Taml */
  415. G_UNICODE_SCRIPT_TELUGU, /* Telu */
  416. G_UNICODE_SCRIPT_THAANA, /* Thaa */
  417. G_UNICODE_SCRIPT_THAI, /* Thai */
  418. G_UNICODE_SCRIPT_TIBETAN, /* Tibt */
  419. G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
  420. G_UNICODE_SCRIPT_YI, /* Yiii */
  421. G_UNICODE_SCRIPT_TAGALOG, /* Tglg */
  422. G_UNICODE_SCRIPT_HANUNOO, /* Hano */
  423. G_UNICODE_SCRIPT_BUHID, /* Buhd */
  424. G_UNICODE_SCRIPT_TAGBANWA, /* Tagb */
  425. /* Unicode-4.0 additions */
  426. G_UNICODE_SCRIPT_BRAILLE, /* Brai */
  427. G_UNICODE_SCRIPT_CYPRIOT, /* Cprt */
  428. G_UNICODE_SCRIPT_LIMBU, /* Limb */
  429. G_UNICODE_SCRIPT_OSMANYA, /* Osma */
  430. G_UNICODE_SCRIPT_SHAVIAN, /* Shaw */
  431. G_UNICODE_SCRIPT_LINEAR_B, /* Linb */
  432. G_UNICODE_SCRIPT_TAI_LE, /* Tale */
  433. G_UNICODE_SCRIPT_UGARITIC, /* Ugar */
  434. /* Unicode-4.1 additions */
  435. G_UNICODE_SCRIPT_NEW_TAI_LUE, /* Talu */
  436. G_UNICODE_SCRIPT_BUGINESE, /* Bugi */
  437. G_UNICODE_SCRIPT_GLAGOLITIC, /* Glag */
  438. G_UNICODE_SCRIPT_TIFINAGH, /* Tfng */
  439. G_UNICODE_SCRIPT_SYLOTI_NAGRI, /* Sylo */
  440. G_UNICODE_SCRIPT_OLD_PERSIAN, /* Xpeo */
  441. G_UNICODE_SCRIPT_KHAROSHTHI, /* Khar */
  442. /* Unicode-5.0 additions */
  443. G_UNICODE_SCRIPT_UNKNOWN, /* Zzzz */
  444. G_UNICODE_SCRIPT_BALINESE, /* Bali */
  445. G_UNICODE_SCRIPT_CUNEIFORM, /* Xsux */
  446. G_UNICODE_SCRIPT_PHOENICIAN, /* Phnx */
  447. G_UNICODE_SCRIPT_PHAGS_PA, /* Phag */
  448. G_UNICODE_SCRIPT_NKO, /* Nkoo */
  449. /* Unicode-5.1 additions */
  450. G_UNICODE_SCRIPT_KAYAH_LI, /* Kali */
  451. G_UNICODE_SCRIPT_LEPCHA, /* Lepc */
  452. G_UNICODE_SCRIPT_REJANG, /* Rjng */
  453. G_UNICODE_SCRIPT_SUNDANESE, /* Sund */
  454. G_UNICODE_SCRIPT_SAURASHTRA, /* Saur */
  455. G_UNICODE_SCRIPT_CHAM, /* Cham */
  456. G_UNICODE_SCRIPT_OL_CHIKI, /* Olck */
  457. G_UNICODE_SCRIPT_VAI, /* Vaii */
  458. G_UNICODE_SCRIPT_CARIAN, /* Cari */
  459. G_UNICODE_SCRIPT_LYCIAN, /* Lyci */
  460. G_UNICODE_SCRIPT_LYDIAN, /* Lydi */
  461. /* Unicode-5.2 additions */
  462. G_UNICODE_SCRIPT_AVESTAN, /* Avst */
  463. G_UNICODE_SCRIPT_BAMUM, /* Bamu */
  464. G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */
  465. G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC, /* Armi */
  466. G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */
  467. G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */
  468. G_UNICODE_SCRIPT_JAVANESE, /* Java */
  469. G_UNICODE_SCRIPT_KAITHI, /* Kthi */
  470. G_UNICODE_SCRIPT_LISU, /* Lisu */
  471. G_UNICODE_SCRIPT_MEETEI_MAYEK, /* Mtei */
  472. G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */
  473. G_UNICODE_SCRIPT_OLD_TURKIC, /* Orkh */
  474. G_UNICODE_SCRIPT_SAMARITAN, /* Samr */
  475. G_UNICODE_SCRIPT_TAI_THAM, /* Lana */
  476. G_UNICODE_SCRIPT_TAI_VIET, /* Tavt */
  477. /* Unicode-6.0 additions */
  478. G_UNICODE_SCRIPT_BATAK, /* Batk */
  479. G_UNICODE_SCRIPT_BRAHMI, /* Brah */
  480. G_UNICODE_SCRIPT_MANDAIC, /* Mand */
  481. /* Unicode-6.1 additions */
  482. G_UNICODE_SCRIPT_CHAKMA, /* Cakm */
  483. G_UNICODE_SCRIPT_MEROITIC_CURSIVE, /* Merc */
  484. G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, /* Mero */
  485. G_UNICODE_SCRIPT_MIAO, /* Plrd */
  486. G_UNICODE_SCRIPT_SHARADA, /* Shrd */
  487. G_UNICODE_SCRIPT_SORA_SOMPENG, /* Sora */
  488. G_UNICODE_SCRIPT_TAKRI /* Takr */
  489. } GUnicodeScript;
  490. GLIB_AVAILABLE_IN_ALL
  491. guint32 g_unicode_script_to_iso15924 (GUnicodeScript script);
  492. GLIB_AVAILABLE_IN_ALL
  493. GUnicodeScript g_unicode_script_from_iso15924 (guint32 iso15924);
  494. /* These are all analogs of the <ctype.h> functions.
  495. */
  496. GLIB_AVAILABLE_IN_ALL
  497. gboolean g_unichar_isalnum (gunichar c) G_GNUC_CONST;
  498. GLIB_AVAILABLE_IN_ALL
  499. gboolean g_unichar_isalpha (gunichar c) G_GNUC_CONST;
  500. GLIB_AVAILABLE_IN_ALL
  501. gboolean g_unichar_iscntrl (gunichar c) G_GNUC_CONST;
  502. GLIB_AVAILABLE_IN_ALL
  503. gboolean g_unichar_isdigit (gunichar c) G_GNUC_CONST;
  504. GLIB_AVAILABLE_IN_ALL
  505. gboolean g_unichar_isgraph (gunichar c) G_GNUC_CONST;
  506. GLIB_AVAILABLE_IN_ALL
  507. gboolean g_unichar_islower (gunichar c) G_GNUC_CONST;
  508. GLIB_AVAILABLE_IN_ALL
  509. gboolean g_unichar_isprint (gunichar c) G_GNUC_CONST;
  510. GLIB_AVAILABLE_IN_ALL
  511. gboolean g_unichar_ispunct (gunichar c) G_GNUC_CONST;
  512. GLIB_AVAILABLE_IN_ALL
  513. gboolean g_unichar_isspace (gunichar c) G_GNUC_CONST;
  514. GLIB_AVAILABLE_IN_ALL
  515. gboolean g_unichar_isupper (gunichar c) G_GNUC_CONST;
  516. GLIB_AVAILABLE_IN_ALL
  517. gboolean g_unichar_isxdigit (gunichar c) G_GNUC_CONST;
  518. GLIB_AVAILABLE_IN_ALL
  519. gboolean g_unichar_istitle (gunichar c) G_GNUC_CONST;
  520. GLIB_AVAILABLE_IN_ALL
  521. gboolean g_unichar_isdefined (gunichar c) G_GNUC_CONST;
  522. GLIB_AVAILABLE_IN_ALL
  523. gboolean g_unichar_iswide (gunichar c) G_GNUC_CONST;
  524. GLIB_AVAILABLE_IN_ALL
  525. gboolean g_unichar_iswide_cjk(gunichar c) G_GNUC_CONST;
  526. GLIB_AVAILABLE_IN_ALL
  527. gboolean g_unichar_iszerowidth(gunichar c) G_GNUC_CONST;
  528. GLIB_AVAILABLE_IN_ALL
  529. gboolean g_unichar_ismark (gunichar c) G_GNUC_CONST;
  530. /* More <ctype.h> functions. These convert between the three cases.
  531. * See the Unicode book to understand title case. */
  532. GLIB_AVAILABLE_IN_ALL
  533. gunichar g_unichar_toupper (gunichar c) G_GNUC_CONST;
  534. GLIB_AVAILABLE_IN_ALL
  535. gunichar g_unichar_tolower (gunichar c) G_GNUC_CONST;
  536. GLIB_AVAILABLE_IN_ALL
  537. gunichar g_unichar_totitle (gunichar c) G_GNUC_CONST;
  538. /* If C is a digit (according to 'g_unichar_isdigit'), then return its
  539. numeric value. Otherwise return -1. */
  540. GLIB_AVAILABLE_IN_ALL
  541. gint g_unichar_digit_value (gunichar c) G_GNUC_CONST;
  542. GLIB_AVAILABLE_IN_ALL
  543. gint g_unichar_xdigit_value (gunichar c) G_GNUC_CONST;
  544. /* Return the Unicode character type of a given character. */
  545. GLIB_AVAILABLE_IN_ALL
  546. GUnicodeType g_unichar_type (gunichar c) G_GNUC_CONST;
  547. /* Return the line break property for a given character */
  548. GLIB_AVAILABLE_IN_ALL
  549. GUnicodeBreakType g_unichar_break_type (gunichar c) G_GNUC_CONST;
  550. /* Returns the combining class for a given character */
  551. GLIB_AVAILABLE_IN_ALL
  552. gint g_unichar_combining_class (gunichar uc) G_GNUC_CONST;
  553. GLIB_AVAILABLE_IN_ALL
  554. gboolean g_unichar_get_mirror_char (gunichar ch,
  555. gunichar *mirrored_ch);
  556. GLIB_AVAILABLE_IN_ALL
  557. GUnicodeScript g_unichar_get_script (gunichar ch) G_GNUC_CONST;
  558. /* Validate a Unicode character */
  559. GLIB_AVAILABLE_IN_ALL
  560. gboolean g_unichar_validate (gunichar ch) G_GNUC_CONST;
  561. /* Pairwise canonical compose/decompose */
  562. GLIB_AVAILABLE_IN_ALL
  563. gboolean g_unichar_compose (gunichar a,
  564. gunichar b,
  565. gunichar *ch);
  566. GLIB_AVAILABLE_IN_ALL
  567. gboolean g_unichar_decompose (gunichar ch,
  568. gunichar *a,
  569. gunichar *b);
  570. GLIB_AVAILABLE_IN_ALL
  571. gsize g_unichar_fully_decompose (gunichar ch,
  572. gboolean compat,
  573. gunichar *result,
  574. gsize result_len);
  575. /**
  576. * G_UNICHAR_MAX_DECOMPOSITION_LENGTH:
  577. *
  578. * The maximum length (in codepoints) of a compatibility or canonical
  579. * decomposition of a single Unicode character.
  580. *
  581. * This is as defined by Unicode 6.1.
  582. *
  583. * Since: 2.32
  584. */
  585. #define G_UNICHAR_MAX_DECOMPOSITION_LENGTH 18 /* codepoints */
  586. /* Compute canonical ordering of a string in-place. This rearranges
  587. decomposed characters in the string according to their combining
  588. classes. See the Unicode manual for more information. */
  589. GLIB_AVAILABLE_IN_ALL
  590. void g_unicode_canonical_ordering (gunichar *string,
  591. gsize len);
  592. GLIB_DEPRECATED_IN_2_30
  593. gunichar *g_unicode_canonical_decomposition (gunichar ch,
  594. gsize *result_len) G_GNUC_MALLOC;
  595. /* Array of skip-bytes-per-initial character.
  596. */
  597. GLIB_VAR const gchar * const g_utf8_skip;
  598. /**
  599. * g_utf8_next_char:
  600. * @p: Pointer to the start of a valid UTF-8 character
  601. *
  602. * Skips to the next character in a UTF-8 string. The string must be
  603. * valid; this macro is as fast as possible, and has no error-checking.
  604. * You would use this macro to iterate over a string character by
  605. * character. The macro returns the start of the next UTF-8 character.
  606. * Before using this macro, use g_utf8_validate() to validate strings
  607. * that may contain invalid UTF-8.
  608. */
  609. #define g_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(const guchar *)(p)])
  610. GLIB_AVAILABLE_IN_ALL
  611. gunichar g_utf8_get_char (const gchar *p) G_GNUC_PURE;
  612. GLIB_AVAILABLE_IN_ALL
  613. gunichar g_utf8_get_char_validated (const gchar *p,
  614. gssize max_len) G_GNUC_PURE;
  615. GLIB_AVAILABLE_IN_ALL
  616. gchar* g_utf8_offset_to_pointer (const gchar *str,
  617. glong offset) G_GNUC_PURE;
  618. GLIB_AVAILABLE_IN_ALL
  619. glong g_utf8_pointer_to_offset (const gchar *str,
  620. const gchar *pos) G_GNUC_PURE;
  621. GLIB_AVAILABLE_IN_ALL
  622. gchar* g_utf8_prev_char (const gchar *p) G_GNUC_PURE;
  623. GLIB_AVAILABLE_IN_ALL
  624. gchar* g_utf8_find_next_char (const gchar *p,
  625. const gchar *end) G_GNUC_PURE;
  626. GLIB_AVAILABLE_IN_ALL
  627. gchar* g_utf8_find_prev_char (const gchar *str,
  628. const gchar *p) G_GNUC_PURE;
  629. GLIB_AVAILABLE_IN_ALL
  630. glong g_utf8_strlen (const gchar *p,
  631. gssize max) G_GNUC_PURE;
  632. GLIB_AVAILABLE_IN_2_30
  633. gchar *g_utf8_substring (const gchar *str,
  634. glong start_pos,
  635. glong end_pos) G_GNUC_MALLOC;
  636. GLIB_AVAILABLE_IN_ALL
  637. gchar *g_utf8_strncpy (gchar *dest,
  638. const gchar *src,
  639. gsize n);
  640. /* Find the UTF-8 character corresponding to ch, in string p. These
  641. functions are equivalants to strchr and strrchr */
  642. GLIB_AVAILABLE_IN_ALL
  643. gchar* g_utf8_strchr (const gchar *p,
  644. gssize len,
  645. gunichar c);
  646. GLIB_AVAILABLE_IN_ALL
  647. gchar* g_utf8_strrchr (const gchar *p,
  648. gssize len,
  649. gunichar c);
  650. GLIB_AVAILABLE_IN_ALL
  651. gchar* g_utf8_strreverse (const gchar *str,
  652. gssize len);
  653. GLIB_AVAILABLE_IN_ALL
  654. gunichar2 *g_utf8_to_utf16 (const gchar *str,
  655. glong len,
  656. glong *items_read,
  657. glong *items_written,
  658. GError **error) G_GNUC_MALLOC;
  659. GLIB_AVAILABLE_IN_ALL
  660. gunichar * g_utf8_to_ucs4 (const gchar *str,
  661. glong len,
  662. glong *items_read,
  663. glong *items_written,
  664. GError **error) G_GNUC_MALLOC;
  665. GLIB_AVAILABLE_IN_ALL
  666. gunichar * g_utf8_to_ucs4_fast (const gchar *str,
  667. glong len,
  668. glong *items_written) G_GNUC_MALLOC;
  669. GLIB_AVAILABLE_IN_ALL
  670. gunichar * g_utf16_to_ucs4 (const gunichar2 *str,
  671. glong len,
  672. glong *items_read,
  673. glong *items_written,
  674. GError **error) G_GNUC_MALLOC;
  675. GLIB_AVAILABLE_IN_ALL
  676. gchar* g_utf16_to_utf8 (const gunichar2 *str,
  677. glong len,
  678. glong *items_read,
  679. glong *items_written,
  680. GError **error) G_GNUC_MALLOC;
  681. GLIB_AVAILABLE_IN_ALL
  682. gunichar2 *g_ucs4_to_utf16 (const gunichar *str,
  683. glong len,
  684. glong *items_read,
  685. glong *items_written,
  686. GError **error) G_GNUC_MALLOC;
  687. GLIB_AVAILABLE_IN_ALL
  688. gchar* g_ucs4_to_utf8 (const gunichar *str,
  689. glong len,
  690. glong *items_read,
  691. glong *items_written,
  692. GError **error) G_GNUC_MALLOC;
  693. GLIB_AVAILABLE_IN_ALL
  694. gint g_unichar_to_utf8 (gunichar c,
  695. gchar *outbuf);
  696. GLIB_AVAILABLE_IN_ALL
  697. gboolean g_utf8_validate (const gchar *str,
  698. gssize max_len,
  699. const gchar **end);
  700. GLIB_AVAILABLE_IN_ALL
  701. gchar *g_utf8_strup (const gchar *str,
  702. gssize len) G_GNUC_MALLOC;
  703. GLIB_AVAILABLE_IN_ALL
  704. gchar *g_utf8_strdown (const gchar *str,
  705. gssize len) G_GNUC_MALLOC;
  706. GLIB_AVAILABLE_IN_ALL
  707. gchar *g_utf8_casefold (const gchar *str,
  708. gssize len) G_GNUC_MALLOC;
  709. /**
  710. * GNormalizeMode:
  711. * @G_NORMALIZE_DEFAULT: standardize differences that do not affect the
  712. * text content, such as the above-mentioned accent representation
  713. * @G_NORMALIZE_NFD: another name for %G_NORMALIZE_DEFAULT
  714. * @G_NORMALIZE_DEFAULT_COMPOSE: like %G_NORMALIZE_DEFAULT, but with
  715. * composed forms rather than a maximally decomposed form
  716. * @G_NORMALIZE_NFC: another name for %G_NORMALIZE_DEFAULT_COMPOSE
  717. * @G_NORMALIZE_ALL: beyond %G_NORMALIZE_DEFAULT also standardize the
  718. * "compatibility" characters in Unicode, such as SUPERSCRIPT THREE
  719. * to the standard forms (in this case DIGIT THREE). Formatting
  720. * information may be lost but for most text operations such
  721. * characters should be considered the same
  722. * @G_NORMALIZE_NFKD: another name for %G_NORMALIZE_ALL
  723. * @G_NORMALIZE_ALL_COMPOSE: like %G_NORMALIZE_ALL, but with composed
  724. * forms rather than a maximally decomposed form
  725. * @G_NORMALIZE_NFKC: another name for %G_NORMALIZE_ALL_COMPOSE
  726. *
  727. * Defines how a Unicode string is transformed in a canonical
  728. * form, standardizing such issues as whether a character with
  729. * an accent is represented as a base character and combining
  730. * accent or as a single precomposed character. Unicode strings
  731. * should generally be normalized before comparing them.
  732. */
  733. typedef enum {
  734. G_NORMALIZE_DEFAULT,
  735. G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT,
  736. G_NORMALIZE_DEFAULT_COMPOSE,
  737. G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE,
  738. G_NORMALIZE_ALL,
  739. G_NORMALIZE_NFKD = G_NORMALIZE_ALL,
  740. G_NORMALIZE_ALL_COMPOSE,
  741. G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE
  742. } GNormalizeMode;
  743. GLIB_AVAILABLE_IN_ALL
  744. gchar *g_utf8_normalize (const gchar *str,
  745. gssize len,
  746. GNormalizeMode mode) G_GNUC_MALLOC;
  747. GLIB_AVAILABLE_IN_ALL
  748. gint g_utf8_collate (const gchar *str1,
  749. const gchar *str2) G_GNUC_PURE;
  750. GLIB_AVAILABLE_IN_ALL
  751. gchar *g_utf8_collate_key (const gchar *str,
  752. gssize len) G_GNUC_MALLOC;
  753. GLIB_AVAILABLE_IN_ALL
  754. gchar *g_utf8_collate_key_for_filename (const gchar *str,
  755. gssize len) G_GNUC_MALLOC;
  756. /* private */
  757. gchar *_g_utf8_make_valid (const gchar *name);
  758. G_END_DECLS
  759. #endif /* __G_UNICODE_H__ */