pango 2.2.0-x86-mingw32 → 2.2.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (407) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +21 -2
  3. data/lib/2.0/pango.so +0 -0
  4. data/vendor/local/bin/derb.exe +0 -0
  5. data/vendor/local/bin/genbrk.exe +0 -0
  6. data/vendor/local/bin/genccode.exe +0 -0
  7. data/vendor/local/bin/gencfu.exe +0 -0
  8. data/vendor/local/bin/gencmn.exe +0 -0
  9. data/vendor/local/bin/gencnval.exe +0 -0
  10. data/vendor/local/bin/gendict.exe +0 -0
  11. data/vendor/local/bin/gennorm2.exe +0 -0
  12. data/vendor/local/bin/genrb.exe +0 -0
  13. data/vendor/local/bin/gensprep.exe +0 -0
  14. data/vendor/local/bin/hb-ot-shape-closure.exe +0 -0
  15. data/vendor/local/bin/hb-shape.exe +0 -0
  16. data/vendor/local/bin/hb-view.exe +0 -0
  17. data/vendor/local/bin/icu-config +820 -0
  18. data/vendor/local/bin/icuinfo.exe +0 -0
  19. data/vendor/local/bin/icupkg.exe +0 -0
  20. data/vendor/local/bin/libharfbuzz-0.dll +0 -0
  21. data/vendor/local/bin/libpango-1.0-0.dll +0 -0
  22. data/vendor/local/bin/libpangocairo-1.0-0.dll +0 -0
  23. data/vendor/local/bin/libpangoft2-1.0-0.dll +0 -0
  24. data/vendor/local/bin/libpangowin32-1.0-0.dll +0 -0
  25. data/vendor/local/bin/libstdc++-6.dll +0 -0
  26. data/vendor/local/bin/makeconv.exe +0 -0
  27. data/vendor/local/bin/pango-querymodules.exe +0 -0
  28. data/vendor/local/bin/pango-view.exe +0 -0
  29. data/vendor/local/bin/pkgdata.exe +0 -0
  30. data/vendor/local/bin/uconv.exe +0 -0
  31. data/vendor/local/etc/pango/pango.modules +3 -3
  32. data/vendor/local/include/harfbuzz/hb-blob.h +3 -4
  33. data/vendor/local/include/harfbuzz/hb-buffer.h +22 -1
  34. data/vendor/local/include/harfbuzz/hb-common.h +23 -18
  35. data/vendor/local/include/harfbuzz/hb-icu.h +52 -0
  36. data/vendor/local/include/harfbuzz/hb-ot-font.h +41 -0
  37. data/vendor/local/include/harfbuzz/hb-ot-layout.h +11 -3
  38. data/vendor/local/include/harfbuzz/hb-ot-shape.h +10 -11
  39. data/vendor/local/include/harfbuzz/hb-ot.h +1 -0
  40. data/vendor/local/include/harfbuzz/hb-version.h +7 -7
  41. data/vendor/local/include/layout/LEFontInstance.h +550 -0
  42. data/vendor/local/include/layout/LEGlyphFilter.h +45 -0
  43. data/vendor/local/include/layout/LEGlyphStorage.h +546 -0
  44. data/vendor/local/include/layout/LEInsertionList.h +177 -0
  45. data/vendor/local/include/layout/LELanguages.h +112 -0
  46. data/vendor/local/include/layout/LEScripts.h +263 -0
  47. data/vendor/local/include/layout/LESwaps.h +100 -0
  48. data/vendor/local/include/layout/LETableReference.h +418 -0
  49. data/vendor/local/include/layout/LETypes.h +728 -0
  50. data/vendor/local/include/layout/LayoutEngine.h +518 -0
  51. data/vendor/local/include/layout/ParagraphLayout.h +747 -0
  52. data/vendor/local/include/layout/RunArrays.h +676 -0
  53. data/vendor/local/include/layout/loengine.h +225 -0
  54. data/vendor/local/include/layout/playout.h +466 -0
  55. data/vendor/local/include/layout/plruns.h +441 -0
  56. data/vendor/local/include/pango-1.0/pango/pango-features.h +2 -2
  57. data/vendor/local/include/pango-1.0/pango/pango-font.h +3 -1
  58. data/vendor/local/include/pango-1.0/pango/pango-item.h +11 -2
  59. data/vendor/local/include/unicode/alphaindex.h +752 -0
  60. data/vendor/local/include/unicode/appendable.h +232 -0
  61. data/vendor/local/include/unicode/basictz.h +214 -0
  62. data/vendor/local/include/unicode/brkiter.h +655 -0
  63. data/vendor/local/include/unicode/bytestream.h +257 -0
  64. data/vendor/local/include/unicode/bytestrie.h +519 -0
  65. data/vendor/local/include/unicode/bytestriebuilder.h +181 -0
  66. data/vendor/local/include/unicode/calendar.h +2519 -0
  67. data/vendor/local/include/unicode/caniter.h +208 -0
  68. data/vendor/local/include/unicode/chariter.h +722 -0
  69. data/vendor/local/include/unicode/choicfmt.h +594 -0
  70. data/vendor/local/include/unicode/coleitr.h +404 -0
  71. data/vendor/local/include/unicode/coll.h +1267 -0
  72. data/vendor/local/include/unicode/compactdecimalformat.h +330 -0
  73. data/vendor/local/include/unicode/curramt.h +130 -0
  74. data/vendor/local/include/unicode/currpinf.h +258 -0
  75. data/vendor/local/include/unicode/currunit.h +110 -0
  76. data/vendor/local/include/unicode/datefmt.h +883 -0
  77. data/vendor/local/include/unicode/dbbi.h +40 -0
  78. data/vendor/local/include/unicode/dcfmtsym.h +482 -0
  79. data/vendor/local/include/unicode/decimfmt.h +2479 -0
  80. data/vendor/local/include/unicode/docmain.h +215 -0
  81. data/vendor/local/include/unicode/dtfmtsym.h +912 -0
  82. data/vendor/local/include/unicode/dtintrv.h +158 -0
  83. data/vendor/local/include/unicode/dtitvfmt.h +985 -0
  84. data/vendor/local/include/unicode/dtitvinf.h +514 -0
  85. data/vendor/local/include/unicode/dtptngen.h +498 -0
  86. data/vendor/local/include/unicode/dtrule.h +250 -0
  87. data/vendor/local/include/unicode/enumset.h +64 -0
  88. data/vendor/local/include/unicode/errorcode.h +137 -0
  89. data/vendor/local/include/unicode/fieldpos.h +291 -0
  90. data/vendor/local/include/unicode/filteredbrk.h +131 -0
  91. data/vendor/local/include/unicode/fmtable.h +760 -0
  92. data/vendor/local/include/unicode/format.h +305 -0
  93. data/vendor/local/include/unicode/fpositer.h +117 -0
  94. data/vendor/local/include/unicode/gender.h +111 -0
  95. data/vendor/local/include/unicode/gregocal.h +777 -0
  96. data/vendor/local/include/unicode/icudataver.h +41 -0
  97. data/vendor/local/include/unicode/icuplug.h +371 -0
  98. data/vendor/local/include/unicode/idna.h +323 -0
  99. data/vendor/local/include/unicode/listformatter.h +167 -0
  100. data/vendor/local/include/unicode/localpointer.h +304 -0
  101. data/vendor/local/include/unicode/locdspnm.h +204 -0
  102. data/vendor/local/include/unicode/locid.h +815 -0
  103. data/vendor/local/include/unicode/measfmt.h +389 -0
  104. data/vendor/local/include/unicode/measunit.h +1443 -0
  105. data/vendor/local/include/unicode/measure.h +159 -0
  106. data/vendor/local/include/unicode/messagepattern.h +943 -0
  107. data/vendor/local/include/unicode/msgfmt.h +1093 -0
  108. data/vendor/local/include/unicode/normalizer2.h +658 -0
  109. data/vendor/local/include/unicode/normlzr.h +797 -0
  110. data/vendor/local/include/unicode/numfmt.h +1187 -0
  111. data/vendor/local/include/unicode/numsys.h +208 -0
  112. data/vendor/local/include/unicode/parseerr.h +92 -0
  113. data/vendor/local/include/unicode/parsepos.h +230 -0
  114. data/vendor/local/include/unicode/platform.h +751 -0
  115. data/vendor/local/include/unicode/plurfmt.h +615 -0
  116. data/vendor/local/include/unicode/plurrule.h +501 -0
  117. data/vendor/local/include/unicode/ptypes.h +126 -0
  118. data/vendor/local/include/unicode/putil.h +181 -0
  119. data/vendor/local/include/unicode/rbbi.h +782 -0
  120. data/vendor/local/include/unicode/rbnf.h +1032 -0
  121. data/vendor/local/include/unicode/rbtz.h +362 -0
  122. data/vendor/local/include/unicode/regex.h +1857 -0
  123. data/vendor/local/include/unicode/region.h +228 -0
  124. data/vendor/local/include/unicode/reldatefmt.h +498 -0
  125. data/vendor/local/include/unicode/rep.h +261 -0
  126. data/vendor/local/include/unicode/resbund.h +490 -0
  127. data/vendor/local/include/unicode/schriter.h +187 -0
  128. data/vendor/local/include/unicode/scientificformathelper.h +139 -0
  129. data/vendor/local/include/unicode/search.h +575 -0
  130. data/vendor/local/include/unicode/selfmt.h +367 -0
  131. data/vendor/local/include/unicode/simpletz.h +928 -0
  132. data/vendor/local/include/unicode/smpdtfmt.h +1592 -0
  133. data/vendor/local/include/unicode/sortkey.h +338 -0
  134. data/vendor/local/include/unicode/std_string.h +37 -0
  135. data/vendor/local/include/unicode/strenum.h +276 -0
  136. data/vendor/local/include/unicode/stringpiece.h +224 -0
  137. data/vendor/local/include/unicode/stringtriebuilder.h +402 -0
  138. data/vendor/local/include/unicode/stsearch.h +504 -0
  139. data/vendor/local/include/unicode/symtable.h +112 -0
  140. data/vendor/local/include/unicode/tblcoll.h +873 -0
  141. data/vendor/local/include/unicode/timezone.h +948 -0
  142. data/vendor/local/include/unicode/tmunit.h +129 -0
  143. data/vendor/local/include/unicode/tmutamt.h +168 -0
  144. data/vendor/local/include/unicode/tmutfmt.h +243 -0
  145. data/vendor/local/include/unicode/translit.h +1342 -0
  146. data/vendor/local/include/unicode/tzfmt.h +1098 -0
  147. data/vendor/local/include/unicode/tznames.h +404 -0
  148. data/vendor/local/include/unicode/tzrule.h +828 -0
  149. data/vendor/local/include/unicode/tztrans.h +195 -0
  150. data/vendor/local/include/unicode/ubidi.h +2186 -0
  151. data/vendor/local/include/unicode/ubrk.h +540 -0
  152. data/vendor/local/include/unicode/ucal.h +1560 -0
  153. data/vendor/local/include/unicode/ucasemap.h +423 -0
  154. data/vendor/local/include/unicode/ucat.h +158 -0
  155. data/vendor/local/include/unicode/uchar.h +3426 -0
  156. data/vendor/local/include/unicode/ucharstrie.h +576 -0
  157. data/vendor/local/include/unicode/ucharstriebuilder.h +185 -0
  158. data/vendor/local/include/unicode/uchriter.h +381 -0
  159. data/vendor/local/include/unicode/uclean.h +258 -0
  160. data/vendor/local/include/unicode/ucnv.h +2036 -0
  161. data/vendor/local/include/unicode/ucnv_cb.h +162 -0
  162. data/vendor/local/include/unicode/ucnv_err.h +463 -0
  163. data/vendor/local/include/unicode/ucnvsel.h +187 -0
  164. data/vendor/local/include/unicode/ucol.h +1474 -0
  165. data/vendor/local/include/unicode/ucoleitr.h +266 -0
  166. data/vendor/local/include/unicode/uconfig.h +430 -0
  167. data/vendor/local/include/unicode/ucsdet.h +413 -0
  168. data/vendor/local/include/unicode/ucurr.h +424 -0
  169. data/vendor/local/include/unicode/udat.h +1536 -0
  170. data/vendor/local/include/unicode/udata.h +430 -0
  171. data/vendor/local/include/unicode/udateintervalformat.h +181 -0
  172. data/vendor/local/include/unicode/udatpg.h +588 -0
  173. data/vendor/local/include/unicode/udisplaycontext.h +150 -0
  174. data/vendor/local/include/unicode/uenum.h +206 -0
  175. data/vendor/local/include/unicode/uformattable.h +280 -0
  176. data/vendor/local/include/unicode/ugender.h +82 -0
  177. data/vendor/local/include/unicode/uidna.h +762 -0
  178. data/vendor/local/include/unicode/uiter.h +707 -0
  179. data/vendor/local/include/unicode/uldnames.h +302 -0
  180. data/vendor/local/include/unicode/uloc.h +1256 -0
  181. data/vendor/local/include/unicode/ulocdata.h +277 -0
  182. data/vendor/local/include/unicode/umachine.h +356 -0
  183. data/vendor/local/include/unicode/umisc.h +60 -0
  184. data/vendor/local/include/unicode/umsg.h +623 -0
  185. data/vendor/local/include/unicode/unifilt.h +120 -0
  186. data/vendor/local/include/unicode/unifunct.h +125 -0
  187. data/vendor/local/include/unicode/unimatch.h +163 -0
  188. data/vendor/local/include/unicode/unirepl.h +97 -0
  189. data/vendor/local/include/unicode/uniset.h +1691 -0
  190. data/vendor/local/include/unicode/unistr.h +4470 -0
  191. data/vendor/local/include/unicode/unorm.h +561 -0
  192. data/vendor/local/include/unicode/unorm2.h +528 -0
  193. data/vendor/local/include/unicode/unum.h +1328 -0
  194. data/vendor/local/include/unicode/unumsys.h +170 -0
  195. data/vendor/local/include/unicode/uobject.h +320 -0
  196. data/vendor/local/include/unicode/upluralrules.h +145 -0
  197. data/vendor/local/include/unicode/uregex.h +1591 -0
  198. data/vendor/local/include/unicode/uregion.h +248 -0
  199. data/vendor/local/include/unicode/urename.h +1784 -0
  200. data/vendor/local/include/unicode/urep.h +155 -0
  201. data/vendor/local/include/unicode/ures.h +887 -0
  202. data/vendor/local/include/unicode/uscript.h +642 -0
  203. data/vendor/local/include/unicode/usearch.h +885 -0
  204. data/vendor/local/include/unicode/uset.h +1126 -0
  205. data/vendor/local/include/unicode/usetiter.h +318 -0
  206. data/vendor/local/include/unicode/ushape.h +474 -0
  207. data/vendor/local/include/unicode/uspoof.h +1064 -0
  208. data/vendor/local/include/unicode/usprep.h +269 -0
  209. data/vendor/local/include/unicode/ustdio.h +1018 -0
  210. data/vendor/local/include/unicode/ustream.h +68 -0
  211. data/vendor/local/include/unicode/ustring.h +1700 -0
  212. data/vendor/local/include/unicode/ustringtrie.h +95 -0
  213. data/vendor/local/include/unicode/utext.h +1600 -0
  214. data/vendor/local/include/unicode/utf.h +223 -0
  215. data/vendor/local/include/unicode/utf16.h +623 -0
  216. data/vendor/local/include/unicode/utf32.h +23 -0
  217. data/vendor/local/include/unicode/utf8.h +824 -0
  218. data/vendor/local/include/unicode/utf_old.h +1169 -0
  219. data/vendor/local/include/unicode/utmscale.h +481 -0
  220. data/vendor/local/include/unicode/utrace.h +359 -0
  221. data/vendor/local/include/unicode/utrans.h +658 -0
  222. data/vendor/local/include/unicode/utypes.h +723 -0
  223. data/vendor/local/include/unicode/uvernum.h +170 -0
  224. data/vendor/local/include/unicode/uversion.h +193 -0
  225. data/vendor/local/include/unicode/vtzone.h +455 -0
  226. data/vendor/local/lib/girepository-1.0/Pango-1.0.typelib +0 -0
  227. data/vendor/local/lib/girepository-1.0/PangoCairo-1.0.typelib +0 -0
  228. data/vendor/local/lib/girepository-1.0/PangoFT2-1.0.typelib +0 -0
  229. data/vendor/local/lib/icu/54.1/Makefile.inc +293 -0
  230. data/vendor/local/lib/icu/54.1/pkgdata.inc +17 -0
  231. data/vendor/local/lib/icu/Makefile.inc +293 -0
  232. data/vendor/local/lib/icu/pkgdata.inc +17 -0
  233. data/vendor/local/lib/icudt.dll +0 -0
  234. data/vendor/local/lib/icudt54.dll +0 -0
  235. data/vendor/local/lib/icuin.dll +0 -0
  236. data/vendor/local/lib/icuin54.dll +0 -0
  237. data/vendor/local/lib/icuio.dll +0 -0
  238. data/vendor/local/lib/icuio54.dll +0 -0
  239. data/vendor/local/lib/icule.dll +0 -0
  240. data/vendor/local/lib/icule54.dll +0 -0
  241. data/vendor/local/lib/iculx.dll +0 -0
  242. data/vendor/local/lib/iculx54.dll +0 -0
  243. data/vendor/local/lib/icutest.dll +0 -0
  244. data/vendor/local/lib/icutest54.dll +0 -0
  245. data/vendor/local/lib/icutu.dll +0 -0
  246. data/vendor/local/lib/icutu54.dll +0 -0
  247. data/vendor/local/lib/icuuc.dll +0 -0
  248. data/vendor/local/lib/icuuc54.dll +0 -0
  249. data/vendor/local/lib/libharfbuzz-icu.a +0 -0
  250. data/vendor/local/lib/libharfbuzz-icu.la +41 -0
  251. data/vendor/local/lib/libharfbuzz.dll.a +0 -0
  252. data/vendor/local/lib/libharfbuzz.la +3 -3
  253. data/vendor/local/lib/libicudt.dll.a +0 -0
  254. data/vendor/local/lib/libicuin.dll.a +0 -0
  255. data/vendor/local/lib/libicuio.dll.a +0 -0
  256. data/vendor/local/lib/libicule.dll.a +0 -0
  257. data/vendor/local/lib/libiculx.dll.a +0 -0
  258. data/vendor/local/lib/libicutest.dll.a +0 -0
  259. data/vendor/local/lib/libicutu.dll.a +0 -0
  260. data/vendor/local/lib/libicuuc.dll.a +0 -0
  261. data/vendor/local/lib/libpango-1.0.dll.a +0 -0
  262. data/vendor/local/lib/libpango-1.0.la +2 -2
  263. data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
  264. data/vendor/local/lib/libpangocairo-1.0.la +2 -2
  265. data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
  266. data/vendor/local/lib/libpangoft2-1.0.la +2 -2
  267. data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
  268. data/vendor/local/lib/libpangowin32-1.0.la +2 -2
  269. data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll +0 -0
  270. data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll.a +0 -0
  271. data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.la +1 -1
  272. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll +0 -0
  273. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll.a +0 -0
  274. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.la +1 -1
  275. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll +0 -0
  276. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll.a +0 -0
  277. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.la +1 -1
  278. data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll +0 -0
  279. data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll.a +0 -0
  280. data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.la +1 -1
  281. data/vendor/local/lib/pkgconfig/harfbuzz-icu.pc +13 -0
  282. data/vendor/local/lib/pkgconfig/harfbuzz.pc +1 -1
  283. data/vendor/local/lib/pkgconfig/icu-i18n.pc +38 -0
  284. data/vendor/local/lib/pkgconfig/icu-io.pc +38 -0
  285. data/vendor/local/lib/pkgconfig/icu-le.pc +38 -0
  286. data/vendor/local/lib/pkgconfig/icu-lx.pc +38 -0
  287. data/vendor/local/lib/pkgconfig/icu-uc.pc +38 -0
  288. data/vendor/local/lib/pkgconfig/pango.pc +1 -1
  289. data/vendor/local/lib/pkgconfig/pangocairo.pc +1 -1
  290. data/vendor/local/lib/pkgconfig/pangoft2.pc +1 -1
  291. data/vendor/local/lib/pkgconfig/pangowin32.pc +1 -1
  292. data/vendor/local/share/gir-1.0/Pango-1.0.gir +3009 -462
  293. data/vendor/local/share/gir-1.0/PangoCairo-1.0.gir +64 -22
  294. data/vendor/local/share/gir-1.0/PangoFT2-1.0.gir +4 -2
  295. data/vendor/local/share/gtk-doc/html/harfbuzz/annotation-glossary.html +30 -26
  296. data/vendor/local/share/gtk-doc/html/harfbuzz/api-index-full.html +343 -313
  297. data/vendor/local/share/gtk-doc/html/harfbuzz/ch01.html +5 -5
  298. data/vendor/local/share/gtk-doc/html/harfbuzz/deprecated-api-index.html +6 -8
  299. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-blob.html +442 -247
  300. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-buffer.html +1389 -654
  301. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-common.html +954 -698
  302. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-coretext.html +95 -18
  303. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-deprecated.html +36 -27
  304. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-face.html +477 -191
  305. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-font.html +1951 -1039
  306. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ft.html +123 -65
  307. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-glib.html +66 -21
  308. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-gobject.html +11 -13
  309. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-graphite2.html +67 -23
  310. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-icu.html +66 -21
  311. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-layout.html +574 -347
  312. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-tag.html +104 -37
  313. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot.html +10 -27
  314. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-set.html +744 -318
  315. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape-plan.html +294 -153
  316. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape.html +196 -104
  317. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-unicode.html +1100 -757
  318. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-uniscribe.html +51 -18
  319. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-version.html +110 -84
  320. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb.html +11 -13
  321. data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz.devhelp2 +289 -503
  322. data/vendor/local/share/gtk-doc/html/harfbuzz/index.html +3 -3
  323. data/vendor/local/share/gtk-doc/html/harfbuzz/index.sgml +161 -316
  324. data/vendor/local/share/gtk-doc/html/harfbuzz/object-tree.html +31 -4
  325. data/vendor/local/share/gtk-doc/html/harfbuzz/style.css +260 -105
  326. data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +143 -105
  327. data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +150 -108
  328. data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +163 -112
  329. data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +348 -229
  330. data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +746 -514
  331. data/vendor/local/share/gtk-doc/html/pango/PangoMarkupFormat.html +9 -9
  332. data/vendor/local/share/gtk-doc/html/pango/PangoRenderer.html +853 -623
  333. data/vendor/local/share/gtk-doc/html/pango/annotation-glossary.html +29 -13
  334. data/vendor/local/share/gtk-doc/html/pango/api-index-1-10.html +31 -33
  335. data/vendor/local/share/gtk-doc/html/pango/api-index-1-12.html +10 -12
  336. data/vendor/local/share/gtk-doc/html/pango/api-index-1-14.html +12 -14
  337. data/vendor/local/share/gtk-doc/html/pango/api-index-1-16.html +53 -55
  338. data/vendor/local/share/gtk-doc/html/pango/api-index-1-18.html +28 -30
  339. data/vendor/local/share/gtk-doc/html/pango/api-index-1-2.html +29 -31
  340. data/vendor/local/share/gtk-doc/html/pango/api-index-1-20.html +17 -19
  341. data/vendor/local/share/gtk-doc/html/pango/api-index-1-22.html +28 -30
  342. data/vendor/local/share/gtk-doc/html/pango/api-index-1-24.html +17 -19
  343. data/vendor/local/share/gtk-doc/html/pango/api-index-1-26.html +9 -11
  344. data/vendor/local/share/gtk-doc/html/pango/api-index-1-30.html +6 -6
  345. data/vendor/local/share/gtk-doc/html/pango/api-index-1-31-0.html +6 -6
  346. data/vendor/local/share/gtk-doc/html/pango/api-index-1-32-4.html +11 -13
  347. data/vendor/local/share/gtk-doc/html/pango/api-index-1-32.html +7 -9
  348. data/vendor/local/share/gtk-doc/html/pango/api-index-1-34.html +5 -5
  349. data/vendor/local/share/gtk-doc/html/pango/api-index-1-4.html +49 -51
  350. data/vendor/local/share/gtk-doc/html/pango/api-index-1-6.html +36 -38
  351. data/vendor/local/share/gtk-doc/html/pango/api-index-1-8.html +37 -39
  352. data/vendor/local/share/gtk-doc/html/pango/api-index-deprecated.html +68 -70
  353. data/vendor/local/share/gtk-doc/html/pango/api-index-full.html +568 -570
  354. data/vendor/local/share/gtk-doc/html/pango/index.html +3 -3
  355. data/vendor/local/share/gtk-doc/html/pango/index.sgml +229 -399
  356. data/vendor/local/share/gtk-doc/html/pango/lowlevel.html +4 -4
  357. data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +345 -259
  358. data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +979 -664
  359. data/vendor/local/share/gtk-doc/html/pango/pango-CoreText-Fonts.html +70 -43
  360. data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +349 -229
  361. data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +236 -153
  362. data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +3100 -2159
  363. data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +659 -472
  364. data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +1952 -1384
  365. data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +3050 -2135
  366. data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +676 -463
  367. data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +223 -146
  368. data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +1589 -1199
  369. data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +1072 -842
  370. data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +406 -276
  371. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +2541 -1792
  372. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +1479 -1033
  373. data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +214 -154
  374. data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +374 -291
  375. data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +733 -498
  376. data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +893 -617
  377. data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +59 -59
  378. data/vendor/local/share/gtk-doc/html/pango/pango-querymodules.html +5 -5
  379. data/vendor/local/share/gtk-doc/html/pango/pango.devhelp2 +578 -782
  380. data/vendor/local/share/gtk-doc/html/pango/pango.html +4 -4
  381. data/vendor/local/share/gtk-doc/html/pango/rendering.html +4 -4
  382. data/vendor/local/share/gtk-doc/html/pango/style.css +260 -105
  383. data/vendor/local/share/gtk-doc/html/pango/tools.html +4 -4
  384. data/vendor/local/share/icu/54.1/config/mh-mingw +158 -0
  385. data/vendor/local/share/icu/54.1/install-sh +251 -0
  386. data/vendor/local/share/icu/54.1/license.html +385 -0
  387. data/vendor/local/share/icu/54.1/mkinstalldirs +43 -0
  388. data/vendor/local/share/license/harfbuzz/AUTHORS +1 -0
  389. data/vendor/local/share/man/man1/derb.1 +196 -0
  390. data/vendor/local/share/man/man1/genbrk.1 +112 -0
  391. data/vendor/local/share/man/man1/gencfu.1 +91 -0
  392. data/vendor/local/share/man/man1/gencnval.1 +91 -0
  393. data/vendor/local/share/man/man1/gendict.1 +131 -0
  394. data/vendor/local/share/man/man1/genrb.1 +146 -0
  395. data/vendor/local/share/man/man1/icu-config.1 +288 -0
  396. data/vendor/local/share/man/man1/makeconv.1 +112 -0
  397. data/vendor/local/share/man/man1/pango-querymodules.1 +2 -2
  398. data/vendor/local/share/man/man1/pango-view.1 +1 -118
  399. data/vendor/local/share/man/man1/pkgdata.1 +258 -0
  400. data/vendor/local/share/man/man1/uconv.1 +443 -0
  401. data/vendor/local/share/man/man8/genccode.8 +106 -0
  402. data/vendor/local/share/man/man8/gencmn.8 +129 -0
  403. data/vendor/local/share/man/man8/gensprep.8 +102 -0
  404. data/vendor/local/share/man/man8/icupkg.8 +204 -0
  405. metadata +266 -14
  406. data/lib/1.9/pango.so +0 -0
  407. data/lib/2.1/pango.so +0 -0
@@ -0,0 +1,258 @@
1
+ /*
2
+ ******************************************************************************
3
+ * Copyright (C) 2001-2014, International Business Machines
4
+ * Corporation and others. All Rights Reserved.
5
+ ******************************************************************************
6
+ * file name: uclean.h
7
+ * encoding: US-ASCII
8
+ * tab size: 8 (not used)
9
+ * indentation:4
10
+ *
11
+ * created on: 2001July05
12
+ * created by: George Rhoten
13
+ */
14
+
15
+ #ifndef __UCLEAN_H__
16
+ #define __UCLEAN_H__
17
+
18
+ #include "unicode/utypes.h"
19
+ /**
20
+ * \file
21
+ * \brief C API: Initialize and clean up ICU
22
+ */
23
+
24
+ /**
25
+ * Initialize ICU.
26
+ *
27
+ * Use of this function is optional. It is OK to simply use ICU
28
+ * services and functions without first having initialized
29
+ * ICU by calling u_init().
30
+ *
31
+ * u_init() will attempt to load some part of ICU's data, and is
32
+ * useful as a test for configuration or installation problems that
33
+ * leave the ICU data inaccessible. A successful invocation of u_init()
34
+ * does not, however, guarantee that all ICU data is accessible.
35
+ *
36
+ * Multiple calls to u_init() cause no harm, aside from the small amount
37
+ * of time required.
38
+ *
39
+ * In old versions of ICU, u_init() was required in multi-threaded applications
40
+ * to ensure the thread safety of ICU. u_init() is no longer needed for this purpose.
41
+ *
42
+ * @param status An ICU UErrorCode parameter. It must not be <code>NULL</code>.
43
+ * An Error will be returned if some required part of ICU data can not
44
+ * be loaded or initialized.
45
+ * The function returns immediately if the input error code indicates a
46
+ * failure, as usual.
47
+ *
48
+ * @stable ICU 2.6
49
+ */
50
+ U_STABLE void U_EXPORT2
51
+ u_init(UErrorCode *status);
52
+
53
+ #ifndef U_HIDE_SYSTEM_API
54
+ /**
55
+ * Clean up the system resources, such as allocated memory or open files,
56
+ * used in all ICU libraries. This will free/delete all memory owned by the
57
+ * ICU libraries, and return them to their original load state. All open ICU
58
+ * items (collators, resource bundles, converters, etc.) must be closed before
59
+ * calling this function, otherwise ICU may not free its allocated memory
60
+ * (e.g. close your converters and resource bundles before calling this
61
+ * function). Generally, this function should be called once just before
62
+ * an application exits. For applications that dynamically load and unload
63
+ * the ICU libraries (relatively uncommon), u_cleanup() should be called
64
+ * just before the library unload.
65
+ * <p>
66
+ * u_cleanup() also clears any ICU heap functions, mutex functions or
67
+ * trace functions that may have been set for the process.
68
+ * This has the effect of restoring ICU to its initial condition, before
69
+ * any of these override functions were installed. Refer to
70
+ * u_setMemoryFunctions(), u_setMutexFunctions and
71
+ * utrace_setFunctions(). If ICU is to be reinitialized after after
72
+ * calling u_cleanup(), these runtime override functions will need to
73
+ * be set up again if they are still required.
74
+ * <p>
75
+ * u_cleanup() is not thread safe. All other threads should stop using ICU
76
+ * before calling this function.
77
+ * <p>
78
+ * Any open ICU items will be left in an undefined state by u_cleanup(),
79
+ * and any subsequent attempt to use such an item will give unpredictable
80
+ * results.
81
+ * <p>
82
+ * After calling u_cleanup(), an application may continue to use ICU by
83
+ * calling u_init(). An application must invoke u_init() first from one single
84
+ * thread before allowing other threads call u_init(). All threads existing
85
+ * at the time of the first thread's call to u_init() must also call
86
+ * u_init() themselves before continuing with other ICU operations.
87
+ * <p>
88
+ * The use of u_cleanup() just before an application terminates is optional,
89
+ * but it should be called only once for performance reasons. The primary
90
+ * benefit is to eliminate reports of memory or resource leaks originating
91
+ * in ICU code from the results generated by heap analysis tools.
92
+ * <p>
93
+ * <strong>Use this function with great care!</strong>
94
+ * </p>
95
+ *
96
+ * @stable ICU 2.0
97
+ * @system
98
+ */
99
+ U_STABLE void U_EXPORT2
100
+ u_cleanup(void);
101
+
102
+
103
+ /**
104
+ * Pointer type for a user supplied memory allocation function.
105
+ * @param context user supplied value, obtained from from u_setMemoryFunctions().
106
+ * @param size The number of bytes to be allocated
107
+ * @return Pointer to the newly allocated memory, or NULL if the allocation failed.
108
+ * @stable ICU 2.8
109
+ * @system
110
+ */
111
+ typedef void *U_CALLCONV UMemAllocFn(const void *context, size_t size);
112
+ /**
113
+ * Pointer type for a user supplied memory re-allocation function.
114
+ * @param context user supplied value, obtained from from u_setMemoryFunctions().
115
+ * @param size The number of bytes to be allocated
116
+ * @return Pointer to the newly allocated memory, or NULL if the allocation failed.
117
+ * @stable ICU 2.8
118
+ * @system
119
+ */
120
+ typedef void *U_CALLCONV UMemReallocFn(const void *context, void *mem, size_t size);
121
+ /**
122
+ * Pointer type for a user supplied memory free function. Behavior should be
123
+ * similar the standard C library free().
124
+ * @param context user supplied value, obtained from from u_setMemoryFunctions().
125
+ * @param mem Pointer to the memory block to be resized
126
+ * @param size The new size for the block
127
+ * @return Pointer to the resized memory block, or NULL if the resizing failed.
128
+ * @stable ICU 2.8
129
+ * @system
130
+ */
131
+ typedef void U_CALLCONV UMemFreeFn (const void *context, void *mem);
132
+
133
+ /**
134
+ * Set the functions that ICU will use for memory allocation.
135
+ * Use of this function is optional; by default (without this function), ICU will
136
+ * use the standard C library malloc() and free() functions.
137
+ * This function can only be used when ICU is in an initial, unused state, before
138
+ * u_init() has been called.
139
+ * @param context This pointer value will be saved, and then (later) passed as
140
+ * a parameter to the memory functions each time they
141
+ * are called.
142
+ * @param a Pointer to a user-supplied malloc function.
143
+ * @param r Pointer to a user-supplied realloc function.
144
+ * @param f Pointer to a user-supplied free function.
145
+ * @param status Receives error values.
146
+ * @stable ICU 2.8
147
+ * @system
148
+ */
149
+ U_STABLE void U_EXPORT2
150
+ u_setMemoryFunctions(const void *context, UMemAllocFn *a, UMemReallocFn *r, UMemFreeFn *f,
151
+ UErrorCode *status);
152
+
153
+
154
+ #ifndef U_HIDE_DEPRECATED_API
155
+ /*********************************************************************************
156
+ *
157
+ * Deprecated Functions
158
+ *
159
+ * The following functions for user supplied mutexes are no longer supported.
160
+ * Any attempt to use them will return a U_UNSUPPORTED_ERROR.
161
+ *
162
+ **********************************************************************************/
163
+
164
+ /**
165
+ * An opaque pointer type that represents an ICU mutex.
166
+ * For user-implemented mutexes, the value will typically point to a
167
+ * struct or object that implements the mutex.
168
+ * @deprecated ICU 52. This type is no longer supported.
169
+ * @system
170
+ */
171
+ typedef void *UMTX;
172
+
173
+ /**
174
+ * Function Pointer type for a user supplied mutex initialization function.
175
+ * The user-supplied function will be called by ICU whenever ICU needs to create a
176
+ * new mutex. The function implementation should create a mutex, and store a pointer
177
+ * to something that uniquely identifies the mutex into the UMTX that is supplied
178
+ * as a paramter.
179
+ * @param context user supplied value, obtained from from u_setMutexFunctions().
180
+ * @param mutex Receives a pointer that identifies the new mutex.
181
+ * The mutex init function must set the UMTX to a non-null value.
182
+ * Subsequent calls by ICU to lock, unlock, or destroy a mutex will
183
+ * identify the mutex by the UMTX value.
184
+ * @param status Error status. Report errors back to ICU by setting this variable
185
+ * with an error code.
186
+ * @deprecated ICU 52. This function is no longer supported.
187
+ * @system
188
+ */
189
+ typedef void U_CALLCONV UMtxInitFn (const void *context, UMTX *mutex, UErrorCode* status);
190
+
191
+
192
+ /**
193
+ * Function Pointer type for a user supplied mutex functions.
194
+ * One of the user-supplied functions with this signature will be called by ICU
195
+ * whenever ICU needs to lock, unlock, or destroy a mutex.
196
+ * @param context user supplied value, obtained from from u_setMutexFunctions().
197
+ * @param mutex specify the mutex on which to operate.
198
+ * @deprecated ICU 52. This function is no longer supported.
199
+ * @system
200
+ */
201
+ typedef void U_CALLCONV UMtxFn (const void *context, UMTX *mutex);
202
+
203
+
204
+ /**
205
+ * Set the functions that ICU will use for mutex operations
206
+ * Use of this function is optional; by default (without this function), ICU will
207
+ * directly access system functions for mutex operations
208
+ * This function can only be used when ICU is in an initial, unused state, before
209
+ * u_init() has been called.
210
+ * @param context This pointer value will be saved, and then (later) passed as
211
+ * a parameter to the user-supplied mutex functions each time they
212
+ * are called.
213
+ * @param init Pointer to a mutex initialization function. Must be non-null.
214
+ * @param destroy Pointer to the mutex destroy function. Must be non-null.
215
+ * @param lock pointer to the mutex lock function. Must be non-null.
216
+ * @param unlock Pointer to the mutex unlock function. Must be non-null.
217
+ * @param status Receives error values.
218
+ * @deprecated ICU 52. This function is no longer supported.
219
+ * @system
220
+ */
221
+ U_DEPRECATED void U_EXPORT2
222
+ u_setMutexFunctions(const void *context, UMtxInitFn *init, UMtxFn *destroy, UMtxFn *lock, UMtxFn *unlock,
223
+ UErrorCode *status);
224
+
225
+
226
+ /**
227
+ * Pointer type for a user supplied atomic increment or decrement function.
228
+ * @param context user supplied value, obtained from from u_setAtomicIncDecFunctions().
229
+ * @param p Pointer to a 32 bit int to be incremented or decremented
230
+ * @return The value of the variable after the inc or dec operation.
231
+ * @deprecated ICU 52. This function is no longer supported.
232
+ * @system
233
+ */
234
+ typedef int32_t U_CALLCONV UMtxAtomicFn(const void *context, int32_t *p);
235
+
236
+ /**
237
+ * Set the functions that ICU will use for atomic increment and decrement of int32_t values.
238
+ * Use of this function is optional; by default (without this function), ICU will
239
+ * use its own internal implementation of atomic increment/decrement.
240
+ * This function can only be used when ICU is in an initial, unused state, before
241
+ * u_init() has been called.
242
+ * @param context This pointer value will be saved, and then (later) passed as
243
+ * a parameter to the increment and decrement functions each time they
244
+ * are called. This function can only be called
245
+ * @param inc Pointer to a function to do an atomic increment operation. Must be non-null.
246
+ * @param dec Pointer to a function to do an atomic decrement operation. Must be non-null.
247
+ * @param status Receives error values.
248
+ * @deprecated ICU 52. This function is no longer supported.
249
+ * @system
250
+ */
251
+ U_DEPRECATED void U_EXPORT2
252
+ u_setAtomicIncDecFunctions(const void *context, UMtxAtomicFn *inc, UMtxAtomicFn *dec,
253
+ UErrorCode *status);
254
+
255
+ #endif /* U_HIDE_DEPRECATED_API */
256
+ #endif /* U_HIDE_SYSTEM_API */
257
+
258
+ #endif
@@ -0,0 +1,2036 @@
1
+ /*
2
+ **********************************************************************
3
+ * Copyright (C) 1999-2014, International Business Machines
4
+ * Corporation and others. All Rights Reserved.
5
+ **********************************************************************
6
+ * ucnv.h:
7
+ * External APIs for the ICU's codeset conversion library
8
+ * Bertrand A. Damiba
9
+ *
10
+ * Modification History:
11
+ *
12
+ * Date Name Description
13
+ * 04/04/99 helena Fixed internal header inclusion.
14
+ * 05/11/00 helena Added setFallback and usesFallback APIs.
15
+ * 06/29/2000 helena Major rewrite of the callback APIs.
16
+ * 12/07/2000 srl Update of documentation
17
+ */
18
+
19
+ /**
20
+ * \file
21
+ * \brief C API: Character conversion
22
+ *
23
+ * <h2>Character Conversion C API</h2>
24
+ *
25
+ * <p>This API is used to convert codepage or character encoded data to and
26
+ * from UTF-16. You can open a converter with {@link ucnv_open() }. With that
27
+ * converter, you can get its properties, set options, convert your data and
28
+ * close the converter.</p>
29
+ *
30
+ * <p>Since many software programs recogize different converter names for
31
+ * different types of converters, there are other functions in this API to
32
+ * iterate over the converter aliases. The functions {@link ucnv_getAvailableName() },
33
+ * {@link ucnv_getAlias() } and {@link ucnv_getStandardName() } are some of the
34
+ * more frequently used alias functions to get this information.</p>
35
+ *
36
+ * <p>When a converter encounters an illegal, irregular, invalid or unmappable character
37
+ * its default behavior is to use a substitution character to replace the
38
+ * bad byte sequence. This behavior can be changed by using {@link ucnv_setFromUCallBack() }
39
+ * or {@link ucnv_setToUCallBack() } on the converter. The header ucnv_err.h defines
40
+ * many other callback actions that can be used instead of a character substitution.</p>
41
+ *
42
+ * <p>More information about this API can be found in our
43
+ * <a href="http://icu-project.org/userguide/conversion.html">User's
44
+ * Guide</a>.</p>
45
+ */
46
+
47
+ #ifndef UCNV_H
48
+ #define UCNV_H
49
+
50
+ #include "unicode/ucnv_err.h"
51
+ #include "unicode/uenum.h"
52
+ #include "unicode/localpointer.h"
53
+
54
+ #ifndef __USET_H__
55
+
56
+ /**
57
+ * USet is the C API type for Unicode sets.
58
+ * It is forward-declared here to avoid including the header file if related
59
+ * conversion APIs are not used.
60
+ * See unicode/uset.h
61
+ *
62
+ * @see ucnv_getUnicodeSet
63
+ * @stable ICU 2.6
64
+ */
65
+ struct USet;
66
+ /** @stable ICU 2.6 */
67
+ typedef struct USet USet;
68
+
69
+ #endif
70
+
71
+ #if !UCONFIG_NO_CONVERSION
72
+
73
+ U_CDECL_BEGIN
74
+
75
+ /** Maximum length of a converter name including the terminating NULL @stable ICU 2.0 */
76
+ #define UCNV_MAX_CONVERTER_NAME_LENGTH 60
77
+ /** Maximum length of a converter name including path and terminating NULL @stable ICU 2.0 */
78
+ #define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
79
+
80
+ /** Shift in for EBDCDIC_STATEFUL and iso2022 states @stable ICU 2.0 */
81
+ #define UCNV_SI 0x0F
82
+ /** Shift out for EBDCDIC_STATEFUL and iso2022 states @stable ICU 2.0 */
83
+ #define UCNV_SO 0x0E
84
+
85
+ /**
86
+ * Enum for specifying basic types of converters
87
+ * @see ucnv_getType
88
+ * @stable ICU 2.0
89
+ */
90
+ typedef enum {
91
+ /** @stable ICU 2.0 */
92
+ UCNV_UNSUPPORTED_CONVERTER = -1,
93
+ /** @stable ICU 2.0 */
94
+ UCNV_SBCS = 0,
95
+ /** @stable ICU 2.0 */
96
+ UCNV_DBCS = 1,
97
+ /** @stable ICU 2.0 */
98
+ UCNV_MBCS = 2,
99
+ /** @stable ICU 2.0 */
100
+ UCNV_LATIN_1 = 3,
101
+ /** @stable ICU 2.0 */
102
+ UCNV_UTF8 = 4,
103
+ /** @stable ICU 2.0 */
104
+ UCNV_UTF16_BigEndian = 5,
105
+ /** @stable ICU 2.0 */
106
+ UCNV_UTF16_LittleEndian = 6,
107
+ /** @stable ICU 2.0 */
108
+ UCNV_UTF32_BigEndian = 7,
109
+ /** @stable ICU 2.0 */
110
+ UCNV_UTF32_LittleEndian = 8,
111
+ /** @stable ICU 2.0 */
112
+ UCNV_EBCDIC_STATEFUL = 9,
113
+ /** @stable ICU 2.0 */
114
+ UCNV_ISO_2022 = 10,
115
+
116
+ /** @stable ICU 2.0 */
117
+ UCNV_LMBCS_1 = 11,
118
+ /** @stable ICU 2.0 */
119
+ UCNV_LMBCS_2,
120
+ /** @stable ICU 2.0 */
121
+ UCNV_LMBCS_3,
122
+ /** @stable ICU 2.0 */
123
+ UCNV_LMBCS_4,
124
+ /** @stable ICU 2.0 */
125
+ UCNV_LMBCS_5,
126
+ /** @stable ICU 2.0 */
127
+ UCNV_LMBCS_6,
128
+ /** @stable ICU 2.0 */
129
+ UCNV_LMBCS_8,
130
+ /** @stable ICU 2.0 */
131
+ UCNV_LMBCS_11,
132
+ /** @stable ICU 2.0 */
133
+ UCNV_LMBCS_16,
134
+ /** @stable ICU 2.0 */
135
+ UCNV_LMBCS_17,
136
+ /** @stable ICU 2.0 */
137
+ UCNV_LMBCS_18,
138
+ /** @stable ICU 2.0 */
139
+ UCNV_LMBCS_19,
140
+ /** @stable ICU 2.0 */
141
+ UCNV_LMBCS_LAST = UCNV_LMBCS_19,
142
+ /** @stable ICU 2.0 */
143
+ UCNV_HZ,
144
+ /** @stable ICU 2.0 */
145
+ UCNV_SCSU,
146
+ /** @stable ICU 2.0 */
147
+ UCNV_ISCII,
148
+ /** @stable ICU 2.0 */
149
+ UCNV_US_ASCII,
150
+ /** @stable ICU 2.0 */
151
+ UCNV_UTF7,
152
+ /** @stable ICU 2.2 */
153
+ UCNV_BOCU1,
154
+ /** @stable ICU 2.2 */
155
+ UCNV_UTF16,
156
+ /** @stable ICU 2.2 */
157
+ UCNV_UTF32,
158
+ /** @stable ICU 2.2 */
159
+ UCNV_CESU8,
160
+ /** @stable ICU 2.4 */
161
+ UCNV_IMAP_MAILBOX,
162
+ /** @stable ICU 4.8 */
163
+ UCNV_COMPOUND_TEXT,
164
+
165
+ /* Number of converter types for which we have conversion routines. */
166
+ UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES
167
+ } UConverterType;
168
+
169
+ /**
170
+ * Enum for specifying which platform a converter ID refers to.
171
+ * The use of platform/CCSID is not recommended. See ucnv_openCCSID().
172
+ *
173
+ * @see ucnv_getPlatform
174
+ * @see ucnv_openCCSID
175
+ * @see ucnv_getCCSID
176
+ * @stable ICU 2.0
177
+ */
178
+ typedef enum {
179
+ UCNV_UNKNOWN = -1,
180
+ UCNV_IBM = 0
181
+ } UConverterPlatform;
182
+
183
+ /**
184
+ * Function pointer for error callback in the codepage to unicode direction.
185
+ * Called when an error has occured in conversion to unicode, or on open/close of the callback (see reason).
186
+ * @param context Pointer to the callback's private data
187
+ * @param args Information about the conversion in progress
188
+ * @param codeUnits Points to 'length' bytes of the concerned codepage sequence
189
+ * @param length Size (in bytes) of the concerned codepage sequence
190
+ * @param reason Defines the reason the callback was invoked
191
+ * @param pErrorCode ICU error code in/out parameter.
192
+ * For converter callback functions, set to a conversion error
193
+ * before the call, and the callback may reset it to U_ZERO_ERROR.
194
+ * @see ucnv_setToUCallBack
195
+ * @see UConverterToUnicodeArgs
196
+ * @stable ICU 2.0
197
+ */
198
+ typedef void (U_EXPORT2 *UConverterToUCallback) (
199
+ const void* context,
200
+ UConverterToUnicodeArgs *args,
201
+ const char *codeUnits,
202
+ int32_t length,
203
+ UConverterCallbackReason reason,
204
+ UErrorCode *pErrorCode);
205
+
206
+ /**
207
+ * Function pointer for error callback in the unicode to codepage direction.
208
+ * Called when an error has occured in conversion from unicode, or on open/close of the callback (see reason).
209
+ * @param context Pointer to the callback's private data
210
+ * @param args Information about the conversion in progress
211
+ * @param codeUnits Points to 'length' UChars of the concerned Unicode sequence
212
+ * @param length Size (in bytes) of the concerned codepage sequence
213
+ * @param codePoint Single UChar32 (UTF-32) containing the concerend Unicode codepoint.
214
+ * @param reason Defines the reason the callback was invoked
215
+ * @param pErrorCode ICU error code in/out parameter.
216
+ * For converter callback functions, set to a conversion error
217
+ * before the call, and the callback may reset it to U_ZERO_ERROR.
218
+ * @see ucnv_setFromUCallBack
219
+ * @stable ICU 2.0
220
+ */
221
+ typedef void (U_EXPORT2 *UConverterFromUCallback) (
222
+ const void* context,
223
+ UConverterFromUnicodeArgs *args,
224
+ const UChar* codeUnits,
225
+ int32_t length,
226
+ UChar32 codePoint,
227
+ UConverterCallbackReason reason,
228
+ UErrorCode *pErrorCode);
229
+
230
+ U_CDECL_END
231
+
232
+ /**
233
+ * Character that separates converter names from options and options from each other.
234
+ * @see ucnv_open
235
+ * @stable ICU 2.0
236
+ */
237
+ #define UCNV_OPTION_SEP_CHAR ','
238
+
239
+ /**
240
+ * String version of UCNV_OPTION_SEP_CHAR.
241
+ * @see ucnv_open
242
+ * @stable ICU 2.0
243
+ */
244
+ #define UCNV_OPTION_SEP_STRING ","
245
+
246
+ /**
247
+ * Character that separates a converter option from its value.
248
+ * @see ucnv_open
249
+ * @stable ICU 2.0
250
+ */
251
+ #define UCNV_VALUE_SEP_CHAR '='
252
+
253
+ /**
254
+ * String version of UCNV_VALUE_SEP_CHAR.
255
+ * @see ucnv_open
256
+ * @stable ICU 2.0
257
+ */
258
+ #define UCNV_VALUE_SEP_STRING "="
259
+
260
+ /**
261
+ * Converter option for specifying a locale.
262
+ * For example, ucnv_open("SCSU,locale=ja", &errorCode);
263
+ * See convrtrs.txt.
264
+ *
265
+ * @see ucnv_open
266
+ * @stable ICU 2.0
267
+ */
268
+ #define UCNV_LOCALE_OPTION_STRING ",locale="
269
+
270
+ /**
271
+ * Converter option for specifying a version selector (0..9) for some converters.
272
+ * For example,
273
+ * \code
274
+ * ucnv_open("UTF-7,version=1", &errorCode);
275
+ * \endcode
276
+ * See convrtrs.txt.
277
+ *
278
+ * @see ucnv_open
279
+ * @stable ICU 2.4
280
+ */
281
+ #define UCNV_VERSION_OPTION_STRING ",version="
282
+
283
+ /**
284
+ * Converter option for EBCDIC SBCS or mixed-SBCS/DBCS (stateful) codepages.
285
+ * Swaps Unicode mappings for EBCDIC LF and NL codes, as used on
286
+ * S/390 (z/OS) Unix System Services (Open Edition).
287
+ * For example, ucnv_open("ibm-1047,swaplfnl", &errorCode);
288
+ * See convrtrs.txt.
289
+ *
290
+ * @see ucnv_open
291
+ * @stable ICU 2.4
292
+ */
293
+ #define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
294
+
295
+ /**
296
+ * Do a fuzzy compare of two converter/alias names.
297
+ * The comparison is case-insensitive, ignores leading zeroes if they are not
298
+ * followed by further digits, and ignores all but letters and digits.
299
+ * Thus the strings "UTF-8", "utf_8", "u*T@f08" and "Utf 8" are exactly equivalent.
300
+ * See section 1.4, Charset Alias Matching in Unicode Technical Standard #22
301
+ * at http://www.unicode.org/reports/tr22/
302
+ *
303
+ * @param name1 a converter name or alias, zero-terminated
304
+ * @param name2 a converter name or alias, zero-terminated
305
+ * @return 0 if the names match, or a negative value if the name1
306
+ * lexically precedes name2, or a positive value if the name1
307
+ * lexically follows name2.
308
+ * @stable ICU 2.0
309
+ */
310
+ U_STABLE int U_EXPORT2
311
+ ucnv_compareNames(const char *name1, const char *name2);
312
+
313
+
314
+ /**
315
+ * Creates a UConverter object with the name of a coded character set specified as a C string.
316
+ * The actual name will be resolved with the alias file
317
+ * using a case-insensitive string comparison that ignores
318
+ * leading zeroes and all non-alphanumeric characters.
319
+ * E.g., the names "UTF8", "utf-8", "u*T@f08" and "Utf 8" are all equivalent.
320
+ * (See also ucnv_compareNames().)
321
+ * If <code>NULL</code> is passed for the converter name, it will create one with the
322
+ * getDefaultName return value.
323
+ *
324
+ * <p>A converter name for ICU 1.5 and above may contain options
325
+ * like a locale specification to control the specific behavior of
326
+ * the newly instantiated converter.
327
+ * The meaning of the options depends on the particular converter.
328
+ * If an option is not defined for or recognized by a given converter, then it is ignored.</p>
329
+ *
330
+ * <p>Options are appended to the converter name string, with a
331
+ * <code>UCNV_OPTION_SEP_CHAR</code> between the name and the first option and
332
+ * also between adjacent options.</p>
333
+ *
334
+ * <p>If the alias is ambiguous, then the preferred converter is used
335
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.</p>
336
+ *
337
+ * <p>The conversion behavior and names can vary between platforms. ICU may
338
+ * convert some characters differently from other platforms. Details on this topic
339
+ * are in the <a href="http://icu-project.org/userguide/conversion.html">User's
340
+ * Guide</a>. Aliases starting with a "cp" prefix have no specific meaning
341
+ * other than its an alias starting with the letters "cp". Please do not
342
+ * associate any meaning to these aliases.</p>
343
+ *
344
+ * \snippet samples/ucnv/convsamp.cpp ucnv_open
345
+ *
346
+ * @param converterName Name of the coded character set table.
347
+ * This may have options appended to the string.
348
+ * IANA alias character set names, IBM CCSIDs starting with "ibm-",
349
+ * Windows codepage numbers starting with "windows-" are frequently
350
+ * used for this parameter. See ucnv_getAvailableName and
351
+ * ucnv_getAlias for a complete list that is available.
352
+ * If this parameter is NULL, the default converter will be used.
353
+ * @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR</TT>
354
+ * @return the created Unicode converter object, or <TT>NULL</TT> if an error occured
355
+ * @see ucnv_openU
356
+ * @see ucnv_openCCSID
357
+ * @see ucnv_getAvailableName
358
+ * @see ucnv_getAlias
359
+ * @see ucnv_getDefaultName
360
+ * @see ucnv_close
361
+ * @see ucnv_compareNames
362
+ * @stable ICU 2.0
363
+ */
364
+ U_STABLE UConverter* U_EXPORT2
365
+ ucnv_open(const char *converterName, UErrorCode *err);
366
+
367
+
368
+ /**
369
+ * Creates a Unicode converter with the names specified as unicode string.
370
+ * The name should be limited to the ASCII-7 alphanumerics range.
371
+ * The actual name will be resolved with the alias file
372
+ * using a case-insensitive string comparison that ignores
373
+ * leading zeroes and all non-alphanumeric characters.
374
+ * E.g., the names "UTF8", "utf-8", "u*T@f08" and "Utf 8" are all equivalent.
375
+ * (See also ucnv_compareNames().)
376
+ * If <TT>NULL</TT> is passed for the converter name, it will create
377
+ * one with the ucnv_getDefaultName() return value.
378
+ * If the alias is ambiguous, then the preferred converter is used
379
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
380
+ *
381
+ * <p>See ucnv_open for the complete details</p>
382
+ * @param name Name of the UConverter table in a zero terminated
383
+ * Unicode string
384
+ * @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR,
385
+ * U_FILE_ACCESS_ERROR</TT>
386
+ * @return the created Unicode converter object, or <TT>NULL</TT> if an
387
+ * error occured
388
+ * @see ucnv_open
389
+ * @see ucnv_openCCSID
390
+ * @see ucnv_close
391
+ * @see ucnv_compareNames
392
+ * @stable ICU 2.0
393
+ */
394
+ U_STABLE UConverter* U_EXPORT2
395
+ ucnv_openU(const UChar *name,
396
+ UErrorCode *err);
397
+
398
+ /**
399
+ * Creates a UConverter object from a CCSID number and platform pair.
400
+ * Note that the usefulness of this function is limited to platforms with numeric
401
+ * encoding IDs. Only IBM and Microsoft platforms use numeric (16-bit) identifiers for
402
+ * encodings.
403
+ *
404
+ * In addition, IBM CCSIDs and Unicode conversion tables are not 1:1 related.
405
+ * For many IBM CCSIDs there are multiple (up to six) Unicode conversion tables, and
406
+ * for some Unicode conversion tables there are multiple CCSIDs.
407
+ * Some "alternate" Unicode conversion tables are provided by the
408
+ * IBM CDRA conversion table registry.
409
+ * The most prominent example of a systematic modification of conversion tables that is
410
+ * not provided in the form of conversion table files in the repository is
411
+ * that S/390 Unix System Services swaps the codes for Line Feed and New Line in all
412
+ * EBCDIC codepages, which requires such a swap in the Unicode conversion tables as well.
413
+ *
414
+ * Only IBM default conversion tables are accessible with ucnv_openCCSID().
415
+ * ucnv_getCCSID() will return the same CCSID for all conversion tables that are associated
416
+ * with that CCSID.
417
+ *
418
+ * Currently, the only "platform" supported in the ICU converter API is UCNV_IBM.
419
+ *
420
+ * In summary, the use of CCSIDs and the associated API functions is not recommended.
421
+ *
422
+ * In order to open a converter with the default IBM CDRA Unicode conversion table,
423
+ * you can use this function or use the prefix "ibm-":
424
+ * \code
425
+ * char name[20];
426
+ * sprintf(name, "ibm-%hu", ccsid);
427
+ * cnv=ucnv_open(name, &errorCode);
428
+ * \endcode
429
+ *
430
+ * In order to open a converter with the IBM S/390 Unix System Services variant
431
+ * of a Unicode/EBCDIC conversion table,
432
+ * you can use the prefix "ibm-" together with the option string UCNV_SWAP_LFNL_OPTION_STRING:
433
+ * \code
434
+ * char name[20];
435
+ * sprintf(name, "ibm-%hu" UCNV_SWAP_LFNL_OPTION_STRING, ccsid);
436
+ * cnv=ucnv_open(name, &errorCode);
437
+ * \endcode
438
+ *
439
+ * In order to open a converter from a Microsoft codepage number, use the prefix "cp":
440
+ * \code
441
+ * char name[20];
442
+ * sprintf(name, "cp%hu", codepageID);
443
+ * cnv=ucnv_open(name, &errorCode);
444
+ * \endcode
445
+ *
446
+ * If the alias is ambiguous, then the preferred converter is used
447
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
448
+ *
449
+ * @param codepage codepage number to create
450
+ * @param platform the platform in which the codepage number exists
451
+ * @param err error status <TT>U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR</TT>
452
+ * @return the created Unicode converter object, or <TT>NULL</TT> if an error
453
+ * occured.
454
+ * @see ucnv_open
455
+ * @see ucnv_openU
456
+ * @see ucnv_close
457
+ * @see ucnv_getCCSID
458
+ * @see ucnv_getPlatform
459
+ * @see UConverterPlatform
460
+ * @stable ICU 2.0
461
+ */
462
+ U_STABLE UConverter* U_EXPORT2
463
+ ucnv_openCCSID(int32_t codepage,
464
+ UConverterPlatform platform,
465
+ UErrorCode * err);
466
+
467
+ /**
468
+ * <p>Creates a UConverter object specified from a packageName and a converterName.</p>
469
+ *
470
+ * <p>The packageName and converterName must point to an ICU udata object, as defined by
471
+ * <code> udata_open( packageName, "cnv", converterName, err) </code> or equivalent.
472
+ * Typically, packageName will refer to a (.dat) file, or to a package registered with
473
+ * udata_setAppData(). Using a full file or directory pathname for packageName is deprecated.</p>
474
+ *
475
+ * <p>The name will NOT be looked up in the alias mechanism, nor will the converter be
476
+ * stored in the converter cache or the alias table. The only way to open further converters
477
+ * is call this function multiple times, or use the ucnv_safeClone() function to clone a
478
+ * 'master' converter.</p>
479
+ *
480
+ * <p>A future version of ICU may add alias table lookups and/or caching
481
+ * to this function.</p>
482
+ *
483
+ * <p>Example Use:
484
+ * <code>cnv = ucnv_openPackage("myapp", "myconverter", &err);</code>
485
+ * </p>
486
+ *
487
+ * @param packageName name of the package (equivalent to 'path' in udata_open() call)
488
+ * @param converterName name of the data item to be used, without suffix.
489
+ * @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR</TT>
490
+ * @return the created Unicode converter object, or <TT>NULL</TT> if an error occured
491
+ * @see udata_open
492
+ * @see ucnv_open
493
+ * @see ucnv_safeClone
494
+ * @see ucnv_close
495
+ * @stable ICU 2.2
496
+ */
497
+ U_STABLE UConverter* U_EXPORT2
498
+ ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
499
+
500
+ /**
501
+ * Thread safe converter cloning operation.
502
+ * For most efficient operation, pass in a stackBuffer (and a *pBufferSize)
503
+ * with at least U_CNV_SAFECLONE_BUFFERSIZE bytes of space.
504
+ * If the buffer size is sufficient, then the clone will use the stack buffer;
505
+ * otherwise, it will be allocated, and *pBufferSize will indicate
506
+ * the actual size. (This should not occur with U_CNV_SAFECLONE_BUFFERSIZE.)
507
+ *
508
+ * You must ucnv_close() the clone in any case.
509
+ *
510
+ * If *pBufferSize==0, (regardless of whether stackBuffer==NULL or not)
511
+ * then *pBufferSize will be changed to a sufficient size
512
+ * for cloning this converter,
513
+ * without actually cloning the converter ("pure pre-flighting").
514
+ *
515
+ * If *pBufferSize is greater than zero but not large enough for a stack-based
516
+ * clone, then the converter is cloned using newly allocated memory
517
+ * and *pBufferSize is changed to the necessary size.
518
+ *
519
+ * If the converter clone fits into the stack buffer but the stack buffer is not
520
+ * sufficiently aligned for the clone, then the clone will use an
521
+ * adjusted pointer and use an accordingly smaller buffer size.
522
+ *
523
+ * @param cnv converter to be cloned
524
+ * @param stackBuffer <em>Deprecated functionality as of ICU 52, use NULL.</em><br>
525
+ * user allocated space for the new clone. If NULL new memory will be allocated.
526
+ * If buffer is not large enough, new memory will be allocated.
527
+ * Clients can use the U_CNV_SAFECLONE_BUFFERSIZE. This will probably be enough to avoid memory allocations.
528
+ * @param pBufferSize <em>Deprecated functionality as of ICU 52, use NULL or 1.</em><br>
529
+ * pointer to size of allocated space.
530
+ * @param status to indicate whether the operation went on smoothly or there were errors
531
+ * An informational status value, U_SAFECLONE_ALLOCATED_WARNING,
532
+ * is used if any allocations were necessary.
533
+ * However, it is better to check if *pBufferSize grew for checking for
534
+ * allocations because warning codes can be overridden by subsequent
535
+ * function calls.
536
+ * @return pointer to the new clone
537
+ * @stable ICU 2.0
538
+ */
539
+ U_STABLE UConverter * U_EXPORT2
540
+ ucnv_safeClone(const UConverter *cnv,
541
+ void *stackBuffer,
542
+ int32_t *pBufferSize,
543
+ UErrorCode *status);
544
+
545
+ #ifndef U_HIDE_DEPRECATED_API
546
+
547
+ /**
548
+ * \def U_CNV_SAFECLONE_BUFFERSIZE
549
+ * Definition of a buffer size that is designed to be large enough for
550
+ * converters to be cloned with ucnv_safeClone().
551
+ * @deprecated ICU 52. Do not rely on ucnv_safeClone() cloning into any provided buffer.
552
+ */
553
+ #define U_CNV_SAFECLONE_BUFFERSIZE 1024
554
+
555
+ #endif /* U_HIDE_DEPRECATED_API */
556
+
557
+ /**
558
+ * Deletes the unicode converter and releases resources associated
559
+ * with just this instance.
560
+ * Does not free up shared converter tables.
561
+ *
562
+ * @param converter the converter object to be deleted
563
+ * @see ucnv_open
564
+ * @see ucnv_openU
565
+ * @see ucnv_openCCSID
566
+ * @stable ICU 2.0
567
+ */
568
+ U_STABLE void U_EXPORT2
569
+ ucnv_close(UConverter * converter);
570
+
571
+ #if U_SHOW_CPLUSPLUS_API
572
+
573
+ U_NAMESPACE_BEGIN
574
+
575
+ /**
576
+ * \class LocalUConverterPointer
577
+ * "Smart pointer" class, closes a UConverter via ucnv_close().
578
+ * For most methods see the LocalPointerBase base class.
579
+ *
580
+ * @see LocalPointerBase
581
+ * @see LocalPointer
582
+ * @stable ICU 4.4
583
+ */
584
+ U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
585
+
586
+ U_NAMESPACE_END
587
+
588
+ #endif
589
+
590
+ /**
591
+ * Fills in the output parameter, subChars, with the substitution characters
592
+ * as multiple bytes.
593
+ * If ucnv_setSubstString() set a Unicode string because the converter is
594
+ * stateful, then subChars will be an empty string.
595
+ *
596
+ * @param converter the Unicode converter
597
+ * @param subChars the subsitution characters
598
+ * @param len on input the capacity of subChars, on output the number
599
+ * of bytes copied to it
600
+ * @param err the outgoing error status code.
601
+ * If the substitution character array is too small, an
602
+ * <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
603
+ * @see ucnv_setSubstString
604
+ * @see ucnv_setSubstChars
605
+ * @stable ICU 2.0
606
+ */
607
+ U_STABLE void U_EXPORT2
608
+ ucnv_getSubstChars(const UConverter *converter,
609
+ char *subChars,
610
+ int8_t *len,
611
+ UErrorCode *err);
612
+
613
+ /**
614
+ * Sets the substitution chars when converting from unicode to a codepage. The
615
+ * substitution is specified as a string of 1-4 bytes, and may contain
616
+ * <TT>NULL</TT> bytes.
617
+ * The subChars must represent a single character. The caller needs to know the
618
+ * byte sequence of a valid character in the converter's charset.
619
+ * For some converters, for example some ISO 2022 variants, only single-byte
620
+ * substitution characters may be supported.
621
+ * The newer ucnv_setSubstString() function relaxes these limitations.
622
+ *
623
+ * @param converter the Unicode converter
624
+ * @param subChars the substitution character byte sequence we want set
625
+ * @param len the number of bytes in subChars
626
+ * @param err the error status code. <TT>U_INDEX_OUTOFBOUNDS_ERROR </TT> if
627
+ * len is bigger than the maximum number of bytes allowed in subchars
628
+ * @see ucnv_setSubstString
629
+ * @see ucnv_getSubstChars
630
+ * @stable ICU 2.0
631
+ */
632
+ U_STABLE void U_EXPORT2
633
+ ucnv_setSubstChars(UConverter *converter,
634
+ const char *subChars,
635
+ int8_t len,
636
+ UErrorCode *err);
637
+
638
+ /**
639
+ * Set a substitution string for converting from Unicode to a charset.
640
+ * The caller need not know the charset byte sequence for each charset.
641
+ *
642
+ * Unlike ucnv_setSubstChars() which is designed to set a charset byte sequence
643
+ * for a single character, this function takes a Unicode string with
644
+ * zero, one or more characters, and immediately verifies that the string can be
645
+ * converted to the charset.
646
+ * If not, or if the result is too long (more than 32 bytes as of ICU 3.6),
647
+ * then the function returns with an error accordingly.
648
+ *
649
+ * Also unlike ucnv_setSubstChars(), this function works for stateful charsets
650
+ * by converting on the fly at the point of substitution rather than setting
651
+ * a fixed byte sequence.
652
+ *
653
+ * @param cnv The UConverter object.
654
+ * @param s The Unicode string.
655
+ * @param length The number of UChars in s, or -1 for a NUL-terminated string.
656
+ * @param err Pointer to a standard ICU error code. Its input value must
657
+ * pass the U_SUCCESS() test, or else the function returns
658
+ * immediately. Check for U_FAILURE() on output or use with
659
+ * function chaining. (See User Guide for details.)
660
+ *
661
+ * @see ucnv_setSubstChars
662
+ * @see ucnv_getSubstChars
663
+ * @stable ICU 3.6
664
+ */
665
+ U_STABLE void U_EXPORT2
666
+ ucnv_setSubstString(UConverter *cnv,
667
+ const UChar *s,
668
+ int32_t length,
669
+ UErrorCode *err);
670
+
671
+ /**
672
+ * Fills in the output parameter, errBytes, with the error characters from the
673
+ * last failing conversion.
674
+ *
675
+ * @param converter the Unicode converter
676
+ * @param errBytes the codepage bytes which were in error
677
+ * @param len on input the capacity of errBytes, on output the number of
678
+ * bytes which were copied to it
679
+ * @param err the error status code.
680
+ * If the substitution character array is too small, an
681
+ * <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
682
+ * @stable ICU 2.0
683
+ */
684
+ U_STABLE void U_EXPORT2
685
+ ucnv_getInvalidChars(const UConverter *converter,
686
+ char *errBytes,
687
+ int8_t *len,
688
+ UErrorCode *err);
689
+
690
+ /**
691
+ * Fills in the output parameter, errChars, with the error characters from the
692
+ * last failing conversion.
693
+ *
694
+ * @param converter the Unicode converter
695
+ * @param errUChars the UChars which were in error
696
+ * @param len on input the capacity of errUChars, on output the number of
697
+ * UChars which were copied to it
698
+ * @param err the error status code.
699
+ * If the substitution character array is too small, an
700
+ * <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
701
+ * @stable ICU 2.0
702
+ */
703
+ U_STABLE void U_EXPORT2
704
+ ucnv_getInvalidUChars(const UConverter *converter,
705
+ UChar *errUChars,
706
+ int8_t *len,
707
+ UErrorCode *err);
708
+
709
+ /**
710
+ * Resets the state of a converter to the default state. This is used
711
+ * in the case of an error, to restart a conversion from a known default state.
712
+ * It will also empty the internal output buffers.
713
+ * @param converter the Unicode converter
714
+ * @stable ICU 2.0
715
+ */
716
+ U_STABLE void U_EXPORT2
717
+ ucnv_reset(UConverter *converter);
718
+
719
+ /**
720
+ * Resets the to-Unicode part of a converter state to the default state.
721
+ * This is used in the case of an error to restart a conversion to
722
+ * Unicode to a known default state. It will also empty the internal
723
+ * output buffers used for the conversion to Unicode codepoints.
724
+ * @param converter the Unicode converter
725
+ * @stable ICU 2.0
726
+ */
727
+ U_STABLE void U_EXPORT2
728
+ ucnv_resetToUnicode(UConverter *converter);
729
+
730
+ /**
731
+ * Resets the from-Unicode part of a converter state to the default state.
732
+ * This is used in the case of an error to restart a conversion from
733
+ * Unicode to a known default state. It will also empty the internal output
734
+ * buffers used for the conversion from Unicode codepoints.
735
+ * @param converter the Unicode converter
736
+ * @stable ICU 2.0
737
+ */
738
+ U_STABLE void U_EXPORT2
739
+ ucnv_resetFromUnicode(UConverter *converter);
740
+
741
+ /**
742
+ * Returns the maximum number of bytes that are output per UChar in conversion
743
+ * from Unicode using this converter.
744
+ * The returned number can be used with UCNV_GET_MAX_BYTES_FOR_STRING
745
+ * to calculate the size of a target buffer for conversion from Unicode.
746
+ *
747
+ * Note: Before ICU 2.8, this function did not return reliable numbers for
748
+ * some stateful converters (EBCDIC_STATEFUL, ISO-2022) and LMBCS.
749
+ *
750
+ * This number may not be the same as the maximum number of bytes per
751
+ * "conversion unit". In other words, it may not be the intuitively expected
752
+ * number of bytes per character that would be published for a charset,
753
+ * and may not fulfill any other purpose than the allocation of an output
754
+ * buffer of guaranteed sufficient size for a given input length and converter.
755
+ *
756
+ * Examples for special cases that are taken into account:
757
+ * - Supplementary code points may convert to more bytes than BMP code points.
758
+ * This function returns bytes per UChar (UTF-16 code unit), not per
759
+ * Unicode code point, for efficient buffer allocation.
760
+ * - State-shifting output (SI/SO, escapes, etc.) from stateful converters.
761
+ * - When m input UChars are converted to n output bytes, then the maximum m/n
762
+ * is taken into account.
763
+ *
764
+ * The number returned here does not take into account
765
+ * (see UCNV_GET_MAX_BYTES_FOR_STRING):
766
+ * - callbacks which output more than one charset character sequence per call,
767
+ * like escape callbacks
768
+ * - initial and final non-character bytes that are output by some converters
769
+ * (automatic BOMs, initial escape sequence, final SI, etc.)
770
+ *
771
+ * Examples for returned values:
772
+ * - SBCS charsets: 1
773
+ * - Shift-JIS: 2
774
+ * - UTF-16: 2 (2 per BMP, 4 per surrogate _pair_, BOM not counted)
775
+ * - UTF-8: 3 (3 per BMP, 4 per surrogate _pair_)
776
+ * - EBCDIC_STATEFUL (EBCDIC mixed SBCS/DBCS): 3 (SO + DBCS)
777
+ * - ISO-2022: 3 (always outputs UTF-8)
778
+ * - ISO-2022-JP: 6 (4-byte escape sequences + DBCS)
779
+ * - ISO-2022-CN: 8 (4-byte designator sequences + 2-byte SS2/SS3 + DBCS)
780
+ *
781
+ * @param converter The Unicode converter.
782
+ * @return The maximum number of bytes per UChar (16 bit code unit)
783
+ * that are output by ucnv_fromUnicode(),
784
+ * to be used together with UCNV_GET_MAX_BYTES_FOR_STRING
785
+ * for buffer allocation.
786
+ *
787
+ * @see UCNV_GET_MAX_BYTES_FOR_STRING
788
+ * @see ucnv_getMinCharSize
789
+ * @stable ICU 2.0
790
+ */
791
+ U_STABLE int8_t U_EXPORT2
792
+ ucnv_getMaxCharSize(const UConverter *converter);
793
+
794
+ /**
795
+ * Calculates the size of a buffer for conversion from Unicode to a charset.
796
+ * The calculated size is guaranteed to be sufficient for this conversion.
797
+ *
798
+ * It takes into account initial and final non-character bytes that are output
799
+ * by some converters.
800
+ * It does not take into account callbacks which output more than one charset
801
+ * character sequence per call, like escape callbacks.
802
+ * The default (substitution) callback only outputs one charset character sequence.
803
+ *
804
+ * @param length Number of UChars to be converted.
805
+ * @param maxCharSize Return value from ucnv_getMaxCharSize() for the converter
806
+ * that will be used.
807
+ * @return Size of a buffer that will be large enough to hold the output bytes of
808
+ * converting length UChars with the converter that returned the maxCharSize.
809
+ *
810
+ * @see ucnv_getMaxCharSize
811
+ * @stable ICU 2.8
812
+ */
813
+ #define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
814
+ (((int32_t)(length)+10)*(int32_t)(maxCharSize))
815
+
816
+ /**
817
+ * Returns the minimum byte length (per codepoint) for characters in this codepage.
818
+ * This is usually either 1 or 2.
819
+ * @param converter the Unicode converter
820
+ * @return the minimum number of bytes per codepoint allowed by this particular converter
821
+ * @see ucnv_getMaxCharSize
822
+ * @stable ICU 2.0
823
+ */
824
+ U_STABLE int8_t U_EXPORT2
825
+ ucnv_getMinCharSize(const UConverter *converter);
826
+
827
+ /**
828
+ * Returns the display name of the converter passed in based on the Locale
829
+ * passed in. If the locale contains no display name, the internal ASCII
830
+ * name will be filled in.
831
+ *
832
+ * @param converter the Unicode converter.
833
+ * @param displayLocale is the specific Locale we want to localised for
834
+ * @param displayName user provided buffer to be filled in
835
+ * @param displayNameCapacity size of displayName Buffer
836
+ * @param err error status code
837
+ * @return displayNameLength number of UChar needed in displayName
838
+ * @see ucnv_getName
839
+ * @stable ICU 2.0
840
+ */
841
+ U_STABLE int32_t U_EXPORT2
842
+ ucnv_getDisplayName(const UConverter *converter,
843
+ const char *displayLocale,
844
+ UChar *displayName,
845
+ int32_t displayNameCapacity,
846
+ UErrorCode *err);
847
+
848
+ /**
849
+ * Gets the internal, canonical name of the converter (zero-terminated).
850
+ * The lifetime of the returned string will be that of the converter
851
+ * passed to this function.
852
+ * @param converter the Unicode converter
853
+ * @param err UErrorCode status
854
+ * @return the internal name of the converter
855
+ * @see ucnv_getDisplayName
856
+ * @stable ICU 2.0
857
+ */
858
+ U_STABLE const char * U_EXPORT2
859
+ ucnv_getName(const UConverter *converter, UErrorCode *err);
860
+
861
+ /**
862
+ * Gets a codepage number associated with the converter. This is not guaranteed
863
+ * to be the one used to create the converter. Some converters do not represent
864
+ * platform registered codepages and return zero for the codepage number.
865
+ * The error code fill-in parameter indicates if the codepage number
866
+ * is available.
867
+ * Does not check if the converter is <TT>NULL</TT> or if converter's data
868
+ * table is <TT>NULL</TT>.
869
+ *
870
+ * Important: The use of CCSIDs is not recommended because it is limited
871
+ * to only two platforms in principle and only one (UCNV_IBM) in the current
872
+ * ICU converter API.
873
+ * Also, CCSIDs are insufficient to identify IBM Unicode conversion tables precisely.
874
+ * For more details see ucnv_openCCSID().
875
+ *
876
+ * @param converter the Unicode converter
877
+ * @param err the error status code.
878
+ * @return If any error occurrs, -1 will be returned otherwise, the codepage number
879
+ * will be returned
880
+ * @see ucnv_openCCSID
881
+ * @see ucnv_getPlatform
882
+ * @stable ICU 2.0
883
+ */
884
+ U_STABLE int32_t U_EXPORT2
885
+ ucnv_getCCSID(const UConverter *converter,
886
+ UErrorCode *err);
887
+
888
+ /**
889
+ * Gets a codepage platform associated with the converter. Currently,
890
+ * only <TT>UCNV_IBM</TT> will be returned.
891
+ * Does not test if the converter is <TT>NULL</TT> or if converter's data
892
+ * table is <TT>NULL</TT>.
893
+ * @param converter the Unicode converter
894
+ * @param err the error status code.
895
+ * @return The codepage platform
896
+ * @stable ICU 2.0
897
+ */
898
+ U_STABLE UConverterPlatform U_EXPORT2
899
+ ucnv_getPlatform(const UConverter *converter,
900
+ UErrorCode *err);
901
+
902
+ /**
903
+ * Gets the type of the converter
904
+ * e.g. SBCS, MBCS, DBCS, UTF8, UTF16_BE, UTF16_LE, ISO_2022,
905
+ * EBCDIC_STATEFUL, LATIN_1
906
+ * @param converter a valid, opened converter
907
+ * @return the type of the converter
908
+ * @stable ICU 2.0
909
+ */
910
+ U_STABLE UConverterType U_EXPORT2
911
+ ucnv_getType(const UConverter * converter);
912
+
913
+ /**
914
+ * Gets the "starter" (lead) bytes for converters of type MBCS.
915
+ * Will fill in an <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> if converter passed in
916
+ * is not MBCS. Fills in an array of type UBool, with the value of the byte
917
+ * as offset to the array. For example, if (starters[0x20] == TRUE) at return,
918
+ * it means that the byte 0x20 is a starter byte in this converter.
919
+ * Context pointers are always owned by the caller.
920
+ *
921
+ * @param converter a valid, opened converter of type MBCS
922
+ * @param starters an array of size 256 to be filled in
923
+ * @param err error status, <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> if the
924
+ * converter is not a type which can return starters.
925
+ * @see ucnv_getType
926
+ * @stable ICU 2.0
927
+ */
928
+ U_STABLE void U_EXPORT2
929
+ ucnv_getStarters(const UConverter* converter,
930
+ UBool starters[256],
931
+ UErrorCode* err);
932
+
933
+
934
+ /**
935
+ * Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
936
+ * @see ucnv_getUnicodeSet
937
+ * @stable ICU 2.6
938
+ */
939
+ typedef enum UConverterUnicodeSet {
940
+ /** Select the set of roundtrippable Unicode code points. @stable ICU 2.6 */
941
+ UCNV_ROUNDTRIP_SET,
942
+ /** Select the set of Unicode code points with roundtrip or fallback mappings. @stable ICU 4.0 */
943
+ UCNV_ROUNDTRIP_AND_FALLBACK_SET,
944
+ /** Number of UConverterUnicodeSet selectors. @stable ICU 2.6 */
945
+ UCNV_SET_COUNT
946
+ } UConverterUnicodeSet;
947
+
948
+
949
+ /**
950
+ * Returns the set of Unicode code points that can be converted by an ICU converter.
951
+ *
952
+ * Returns one of several kinds of set:
953
+ *
954
+ * 1. UCNV_ROUNDTRIP_SET
955
+ *
956
+ * The set of all Unicode code points that can be roundtrip-converted
957
+ * (converted without any data loss) with the converter (ucnv_fromUnicode()).
958
+ * This set will not include code points that have fallback mappings
959
+ * or are only the result of reverse fallback mappings.
960
+ * This set will also not include PUA code points with fallbacks, although
961
+ * ucnv_fromUnicode() will always uses those mappings despite ucnv_setFallback().
962
+ * See UTR #22 "Character Mapping Markup Language"
963
+ * at http://www.unicode.org/reports/tr22/
964
+ *
965
+ * This is useful for example for
966
+ * - checking that a string or document can be roundtrip-converted with a converter,
967
+ * without/before actually performing the conversion
968
+ * - testing if a converter can be used for text for typical text for a certain locale,
969
+ * by comparing its roundtrip set with the set of ExemplarCharacters from
970
+ * ICU's locale data or other sources
971
+ *
972
+ * 2. UCNV_ROUNDTRIP_AND_FALLBACK_SET
973
+ *
974
+ * The set of all Unicode code points that can be converted with the converter (ucnv_fromUnicode())
975
+ * when fallbacks are turned on (see ucnv_setFallback()).
976
+ * This set includes all code points with roundtrips and fallbacks (but not reverse fallbacks).
977
+ *
978
+ * In the future, there may be more UConverterUnicodeSet choices to select
979
+ * sets with different properties.
980
+ *
981
+ * @param cnv The converter for which a set is requested.
982
+ * @param setFillIn A valid USet *. It will be cleared by this function before
983
+ * the converter's specific set is filled into the USet.
984
+ * @param whichSet A UConverterUnicodeSet selector;
985
+ * currently UCNV_ROUNDTRIP_SET is the only supported value.
986
+ * @param pErrorCode ICU error code in/out parameter.
987
+ * Must fulfill U_SUCCESS before the function call.
988
+ *
989
+ * @see UConverterUnicodeSet
990
+ * @see uset_open
991
+ * @see uset_close
992
+ * @stable ICU 2.6
993
+ */
994
+ U_STABLE void U_EXPORT2
995
+ ucnv_getUnicodeSet(const UConverter *cnv,
996
+ USet *setFillIn,
997
+ UConverterUnicodeSet whichSet,
998
+ UErrorCode *pErrorCode);
999
+
1000
+ /**
1001
+ * Gets the current calback function used by the converter when an illegal
1002
+ * or invalid codepage sequence is found.
1003
+ * Context pointers are always owned by the caller.
1004
+ *
1005
+ * @param converter the unicode converter
1006
+ * @param action fillin: returns the callback function pointer
1007
+ * @param context fillin: returns the callback's private void* context
1008
+ * @see ucnv_setToUCallBack
1009
+ * @stable ICU 2.0
1010
+ */
1011
+ U_STABLE void U_EXPORT2
1012
+ ucnv_getToUCallBack (const UConverter * converter,
1013
+ UConverterToUCallback *action,
1014
+ const void **context);
1015
+
1016
+ /**
1017
+ * Gets the current callback function used by the converter when illegal
1018
+ * or invalid Unicode sequence is found.
1019
+ * Context pointers are always owned by the caller.
1020
+ *
1021
+ * @param converter the unicode converter
1022
+ * @param action fillin: returns the callback function pointer
1023
+ * @param context fillin: returns the callback's private void* context
1024
+ * @see ucnv_setFromUCallBack
1025
+ * @stable ICU 2.0
1026
+ */
1027
+ U_STABLE void U_EXPORT2
1028
+ ucnv_getFromUCallBack (const UConverter * converter,
1029
+ UConverterFromUCallback *action,
1030
+ const void **context);
1031
+
1032
+ /**
1033
+ * Changes the callback function used by the converter when
1034
+ * an illegal or invalid sequence is found.
1035
+ * Context pointers are always owned by the caller.
1036
+ * Predefined actions and contexts can be found in the ucnv_err.h header.
1037
+ *
1038
+ * @param converter the unicode converter
1039
+ * @param newAction the new callback function
1040
+ * @param newContext the new toUnicode callback context pointer. This can be NULL.
1041
+ * @param oldAction fillin: returns the old callback function pointer. This can be NULL.
1042
+ * @param oldContext fillin: returns the old callback's private void* context. This can be NULL.
1043
+ * @param err The error code status
1044
+ * @see ucnv_getToUCallBack
1045
+ * @stable ICU 2.0
1046
+ */
1047
+ U_STABLE void U_EXPORT2
1048
+ ucnv_setToUCallBack (UConverter * converter,
1049
+ UConverterToUCallback newAction,
1050
+ const void* newContext,
1051
+ UConverterToUCallback *oldAction,
1052
+ const void** oldContext,
1053
+ UErrorCode * err);
1054
+
1055
+ /**
1056
+ * Changes the current callback function used by the converter when
1057
+ * an illegal or invalid sequence is found.
1058
+ * Context pointers are always owned by the caller.
1059
+ * Predefined actions and contexts can be found in the ucnv_err.h header.
1060
+ *
1061
+ * @param converter the unicode converter
1062
+ * @param newAction the new callback function
1063
+ * @param newContext the new fromUnicode callback context pointer. This can be NULL.
1064
+ * @param oldAction fillin: returns the old callback function pointer. This can be NULL.
1065
+ * @param oldContext fillin: returns the old callback's private void* context. This can be NULL.
1066
+ * @param err The error code status
1067
+ * @see ucnv_getFromUCallBack
1068
+ * @stable ICU 2.0
1069
+ */
1070
+ U_STABLE void U_EXPORT2
1071
+ ucnv_setFromUCallBack (UConverter * converter,
1072
+ UConverterFromUCallback newAction,
1073
+ const void *newContext,
1074
+ UConverterFromUCallback *oldAction,
1075
+ const void **oldContext,
1076
+ UErrorCode * err);
1077
+
1078
+ /**
1079
+ * Converts an array of unicode characters to an array of codepage
1080
+ * characters. This function is optimized for converting a continuous
1081
+ * stream of data in buffer-sized chunks, where the entire source and
1082
+ * target does not fit in available buffers.
1083
+ *
1084
+ * The source pointer is an in/out parameter. It starts out pointing where the
1085
+ * conversion is to begin, and ends up pointing after the last UChar consumed.
1086
+ *
1087
+ * Target similarly starts out pointer at the first available byte in the output
1088
+ * buffer, and ends up pointing after the last byte written to the output.
1089
+ *
1090
+ * The converter always attempts to consume the entire source buffer, unless
1091
+ * (1.) the target buffer is full, or (2.) a failing error is returned from the
1092
+ * current callback function. When a successful error status has been
1093
+ * returned, it means that all of the source buffer has been
1094
+ * consumed. At that point, the caller should reset the source and
1095
+ * sourceLimit pointers to point to the next chunk.
1096
+ *
1097
+ * At the end of the stream (flush==TRUE), the input is completely consumed
1098
+ * when *source==sourceLimit and no error code is set.
1099
+ * The converter object is then automatically reset by this function.
1100
+ * (This means that a converter need not be reset explicitly between data
1101
+ * streams if it finishes the previous stream without errors.)
1102
+ *
1103
+ * This is a <I>stateful</I> conversion. Additionally, even when all source data has
1104
+ * been consumed, some data may be in the converters' internal state.
1105
+ * Call this function repeatedly, updating the target pointers with
1106
+ * the next empty chunk of target in case of a
1107
+ * <TT>U_BUFFER_OVERFLOW_ERROR</TT>, and updating the source pointers
1108
+ * with the next chunk of source when a successful error status is
1109
+ * returned, until there are no more chunks of source data.
1110
+ * @param converter the Unicode converter
1111
+ * @param target I/O parameter. Input : Points to the beginning of the buffer to copy
1112
+ * codepage characters to. Output : points to after the last codepage character copied
1113
+ * to <TT>target</TT>.
1114
+ * @param targetLimit the pointer just after last of the <TT>target</TT> buffer
1115
+ * @param source I/O parameter, pointer to pointer to the source Unicode character buffer.
1116
+ * @param sourceLimit the pointer just after the last of the source buffer
1117
+ * @param offsets if NULL is passed, nothing will happen to it, otherwise it needs to have the same number
1118
+ * of allocated cells as <TT>target</TT>. Will fill in offsets from target to source pointer
1119
+ * e.g: <TT>offsets[3]</TT> is equal to 6, it means that the <TT>target[3]</TT> was a result of transcoding <TT>source[6]</TT>
1120
+ * For output data carried across calls, and other data without a specific source character
1121
+ * (such as from escape sequences or callbacks) -1 will be placed for offsets.
1122
+ * @param flush set to <TT>TRUE</TT> if the current source buffer is the last available
1123
+ * chunk of the source, <TT>FALSE</TT> otherwise. Note that if a failing status is returned,
1124
+ * this function may have to be called multiple times with flush set to <TT>TRUE</TT> until
1125
+ * the source buffer is consumed.
1126
+ * @param err the error status. <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> will be set if the
1127
+ * converter is <TT>NULL</TT>.
1128
+ * <code>U_BUFFER_OVERFLOW_ERROR</code> will be set if the target is full and there is
1129
+ * still data to be written to the target.
1130
+ * @see ucnv_fromUChars
1131
+ * @see ucnv_convert
1132
+ * @see ucnv_getMinCharSize
1133
+ * @see ucnv_setToUCallBack
1134
+ * @stable ICU 2.0
1135
+ */
1136
+ U_STABLE void U_EXPORT2
1137
+ ucnv_fromUnicode (UConverter * converter,
1138
+ char **target,
1139
+ const char *targetLimit,
1140
+ const UChar ** source,
1141
+ const UChar * sourceLimit,
1142
+ int32_t* offsets,
1143
+ UBool flush,
1144
+ UErrorCode * err);
1145
+
1146
+ /**
1147
+ * Converts a buffer of codepage bytes into an array of unicode UChars
1148
+ * characters. This function is optimized for converting a continuous
1149
+ * stream of data in buffer-sized chunks, where the entire source and
1150
+ * target does not fit in available buffers.
1151
+ *
1152
+ * The source pointer is an in/out parameter. It starts out pointing where the
1153
+ * conversion is to begin, and ends up pointing after the last byte of source consumed.
1154
+ *
1155
+ * Target similarly starts out pointer at the first available UChar in the output
1156
+ * buffer, and ends up pointing after the last UChar written to the output.
1157
+ * It does NOT necessarily keep UChar sequences together.
1158
+ *
1159
+ * The converter always attempts to consume the entire source buffer, unless
1160
+ * (1.) the target buffer is full, or (2.) a failing error is returned from the
1161
+ * current callback function. When a successful error status has been
1162
+ * returned, it means that all of the source buffer has been
1163
+ * consumed. At that point, the caller should reset the source and
1164
+ * sourceLimit pointers to point to the next chunk.
1165
+ *
1166
+ * At the end of the stream (flush==TRUE), the input is completely consumed
1167
+ * when *source==sourceLimit and no error code is set
1168
+ * The converter object is then automatically reset by this function.
1169
+ * (This means that a converter need not be reset explicitly between data
1170
+ * streams if it finishes the previous stream without errors.)
1171
+ *
1172
+ * This is a <I>stateful</I> conversion. Additionally, even when all source data has
1173
+ * been consumed, some data may be in the converters' internal state.
1174
+ * Call this function repeatedly, updating the target pointers with
1175
+ * the next empty chunk of target in case of a
1176
+ * <TT>U_BUFFER_OVERFLOW_ERROR</TT>, and updating the source pointers
1177
+ * with the next chunk of source when a successful error status is
1178
+ * returned, until there are no more chunks of source data.
1179
+ * @param converter the Unicode converter
1180
+ * @param target I/O parameter. Input : Points to the beginning of the buffer to copy
1181
+ * UChars into. Output : points to after the last UChar copied.
1182
+ * @param targetLimit the pointer just after the end of the <TT>target</TT> buffer
1183
+ * @param source I/O parameter, pointer to pointer to the source codepage buffer.
1184
+ * @param sourceLimit the pointer to the byte after the end of the source buffer
1185
+ * @param offsets if NULL is passed, nothing will happen to it, otherwise it needs to have the same number
1186
+ * of allocated cells as <TT>target</TT>. Will fill in offsets from target to source pointer
1187
+ * e.g: <TT>offsets[3]</TT> is equal to 6, it means that the <TT>target[3]</TT> was a result of transcoding <TT>source[6]</TT>
1188
+ * For output data carried across calls, and other data without a specific source character
1189
+ * (such as from escape sequences or callbacks) -1 will be placed for offsets.
1190
+ * @param flush set to <TT>TRUE</TT> if the current source buffer is the last available
1191
+ * chunk of the source, <TT>FALSE</TT> otherwise. Note that if a failing status is returned,
1192
+ * this function may have to be called multiple times with flush set to <TT>TRUE</TT> until
1193
+ * the source buffer is consumed.
1194
+ * @param err the error status. <TT>U_ILLEGAL_ARGUMENT_ERROR</TT> will be set if the
1195
+ * converter is <TT>NULL</TT>.
1196
+ * <code>U_BUFFER_OVERFLOW_ERROR</code> will be set if the target is full and there is
1197
+ * still data to be written to the target.
1198
+ * @see ucnv_fromUChars
1199
+ * @see ucnv_convert
1200
+ * @see ucnv_getMinCharSize
1201
+ * @see ucnv_setFromUCallBack
1202
+ * @see ucnv_getNextUChar
1203
+ * @stable ICU 2.0
1204
+ */
1205
+ U_STABLE void U_EXPORT2
1206
+ ucnv_toUnicode(UConverter *converter,
1207
+ UChar **target,
1208
+ const UChar *targetLimit,
1209
+ const char **source,
1210
+ const char *sourceLimit,
1211
+ int32_t *offsets,
1212
+ UBool flush,
1213
+ UErrorCode *err);
1214
+
1215
+ /**
1216
+ * Convert the Unicode string into a codepage string using an existing UConverter.
1217
+ * The output string is NUL-terminated if possible.
1218
+ *
1219
+ * This function is a more convenient but less powerful version of ucnv_fromUnicode().
1220
+ * It is only useful for whole strings, not for streaming conversion.
1221
+ *
1222
+ * The maximum output buffer capacity required (barring output from callbacks) will be
1223
+ * UCNV_GET_MAX_BYTES_FOR_STRING(srcLength, ucnv_getMaxCharSize(cnv)).
1224
+ *
1225
+ * @param cnv the converter object to be used (ucnv_resetFromUnicode() will be called)
1226
+ * @param src the input Unicode string
1227
+ * @param srcLength the input string length, or -1 if NUL-terminated
1228
+ * @param dest destination string buffer, can be NULL if destCapacity==0
1229
+ * @param destCapacity the number of chars available at dest
1230
+ * @param pErrorCode normal ICU error code;
1231
+ * common error codes that may be set by this function include
1232
+ * U_BUFFER_OVERFLOW_ERROR, U_STRING_NOT_TERMINATED_WARNING,
1233
+ * U_ILLEGAL_ARGUMENT_ERROR, and conversion errors
1234
+ * @return the length of the output string, not counting the terminating NUL;
1235
+ * if the length is greater than destCapacity, then the string will not fit
1236
+ * and a buffer of the indicated length would need to be passed in
1237
+ * @see ucnv_fromUnicode
1238
+ * @see ucnv_convert
1239
+ * @see UCNV_GET_MAX_BYTES_FOR_STRING
1240
+ * @stable ICU 2.0
1241
+ */
1242
+ U_STABLE int32_t U_EXPORT2
1243
+ ucnv_fromUChars(UConverter *cnv,
1244
+ char *dest, int32_t destCapacity,
1245
+ const UChar *src, int32_t srcLength,
1246
+ UErrorCode *pErrorCode);
1247
+
1248
+ /**
1249
+ * Convert the codepage string into a Unicode string using an existing UConverter.
1250
+ * The output string is NUL-terminated if possible.
1251
+ *
1252
+ * This function is a more convenient but less powerful version of ucnv_toUnicode().
1253
+ * It is only useful for whole strings, not for streaming conversion.
1254
+ *
1255
+ * The maximum output buffer capacity required (barring output from callbacks) will be
1256
+ * 2*srcLength (each char may be converted into a surrogate pair).
1257
+ *
1258
+ * @param cnv the converter object to be used (ucnv_resetToUnicode() will be called)
1259
+ * @param src the input codepage string
1260
+ * @param srcLength the input string length, or -1 if NUL-terminated
1261
+ * @param dest destination string buffer, can be NULL if destCapacity==0
1262
+ * @param destCapacity the number of UChars available at dest
1263
+ * @param pErrorCode normal ICU error code;
1264
+ * common error codes that may be set by this function include
1265
+ * U_BUFFER_OVERFLOW_ERROR, U_STRING_NOT_TERMINATED_WARNING,
1266
+ * U_ILLEGAL_ARGUMENT_ERROR, and conversion errors
1267
+ * @return the length of the output string, not counting the terminating NUL;
1268
+ * if the length is greater than destCapacity, then the string will not fit
1269
+ * and a buffer of the indicated length would need to be passed in
1270
+ * @see ucnv_toUnicode
1271
+ * @see ucnv_convert
1272
+ * @stable ICU 2.0
1273
+ */
1274
+ U_STABLE int32_t U_EXPORT2
1275
+ ucnv_toUChars(UConverter *cnv,
1276
+ UChar *dest, int32_t destCapacity,
1277
+ const char *src, int32_t srcLength,
1278
+ UErrorCode *pErrorCode);
1279
+
1280
+ /**
1281
+ * Convert a codepage buffer into Unicode one character at a time.
1282
+ * The input is completely consumed when the U_INDEX_OUTOFBOUNDS_ERROR is set.
1283
+ *
1284
+ * Advantage compared to ucnv_toUnicode() or ucnv_toUChars():
1285
+ * - Faster for small amounts of data, for most converters, e.g.,
1286
+ * US-ASCII, ISO-8859-1, UTF-8/16/32, and most "normal" charsets.
1287
+ * (For complex converters, e.g., SCSU, UTF-7 and ISO 2022 variants,
1288
+ * it uses ucnv_toUnicode() internally.)
1289
+ * - Convenient.
1290
+ *
1291
+ * Limitations compared to ucnv_toUnicode():
1292
+ * - Always assumes flush=TRUE.
1293
+ * This makes ucnv_getNextUChar() unsuitable for "streaming" conversion,
1294
+ * that is, for where the input is supplied in multiple buffers,
1295
+ * because ucnv_getNextUChar() will assume the end of the input at the end
1296
+ * of the first buffer.
1297
+ * - Does not provide offset output.
1298
+ *
1299
+ * It is possible to "mix" ucnv_getNextUChar() and ucnv_toUnicode() because
1300
+ * ucnv_getNextUChar() uses the current state of the converter
1301
+ * (unlike ucnv_toUChars() which always resets first).
1302
+ * However, if ucnv_getNextUChar() is called after ucnv_toUnicode()
1303
+ * stopped in the middle of a character sequence (with flush=FALSE),
1304
+ * then ucnv_getNextUChar() will always use the slower ucnv_toUnicode()
1305
+ * internally until the next character boundary.
1306
+ * (This is new in ICU 2.6. In earlier releases, ucnv_getNextUChar() had to
1307
+ * start at a character boundary.)
1308
+ *
1309
+ * Instead of using ucnv_getNextUChar(), it is recommended
1310
+ * to convert using ucnv_toUnicode() or ucnv_toUChars()
1311
+ * and then iterate over the text using U16_NEXT() or a UCharIterator (uiter.h)
1312
+ * or a C++ CharacterIterator or similar.
1313
+ * This allows streaming conversion and offset output, for example.
1314
+ *
1315
+ * <p>Handling of surrogate pairs and supplementary-plane code points:<br>
1316
+ * There are two different kinds of codepages that provide mappings for surrogate characters:
1317
+ * <ul>
1318
+ * <li>Codepages like UTF-8, UTF-32, and GB 18030 provide direct representations for Unicode
1319
+ * code points U+10000-U+10ffff as well as for single surrogates U+d800-U+dfff.
1320
+ * Each valid sequence will result in exactly one returned code point.
1321
+ * If a sequence results in a single surrogate, then that will be returned
1322
+ * by itself, even if a neighboring sequence encodes the matching surrogate.</li>
1323
+ * <li>Codepages like SCSU and LMBCS (and UTF-16) provide direct representations only for BMP code points
1324
+ * including surrogates. Code points in supplementary planes are represented with
1325
+ * two sequences, each encoding a surrogate.
1326
+ * For these codepages, matching pairs of surrogates will be combined into single
1327
+ * code points for returning from this function.
1328
+ * (Note that SCSU is actually a mix of these codepage types.)</li>
1329
+ * </ul></p>
1330
+ *
1331
+ * @param converter an open UConverter
1332
+ * @param source the address of a pointer to the codepage buffer, will be
1333
+ * updated to point after the bytes consumed in the conversion call.
1334
+ * @param sourceLimit points to the end of the input buffer
1335
+ * @param err fills in error status (see ucnv_toUnicode)
1336
+ * <code>U_INDEX_OUTOFBOUNDS_ERROR</code> will be set if the input
1337
+ * is empty or does not convert to any output (e.g.: pure state-change
1338
+ * codes SI/SO, escape sequences for ISO 2022,
1339
+ * or if the callback did not output anything, ...).
1340
+ * This function will not set a <code>U_BUFFER_OVERFLOW_ERROR</code> because
1341
+ * the "buffer" is the return code. However, there might be subsequent output
1342
+ * stored in the converter object
1343
+ * that will be returned in following calls to this function.
1344
+ * @return a UChar32 resulting from the partial conversion of source
1345
+ * @see ucnv_toUnicode
1346
+ * @see ucnv_toUChars
1347
+ * @see ucnv_convert
1348
+ * @stable ICU 2.0
1349
+ */
1350
+ U_STABLE UChar32 U_EXPORT2
1351
+ ucnv_getNextUChar(UConverter * converter,
1352
+ const char **source,
1353
+ const char * sourceLimit,
1354
+ UErrorCode * err);
1355
+
1356
+ /**
1357
+ * Convert from one external charset to another using two existing UConverters.
1358
+ * Internally, two conversions - ucnv_toUnicode() and ucnv_fromUnicode() -
1359
+ * are used, "pivoting" through 16-bit Unicode.
1360
+ *
1361
+ * Important: For streaming conversion (multiple function calls for successive
1362
+ * parts of a text stream), the caller must provide a pivot buffer explicitly,
1363
+ * and must preserve the pivot buffer and associated pointers from one
1364
+ * call to another. (The buffer may be moved if its contents and the relative
1365
+ * pointer positions are preserved.)
1366
+ *
1367
+ * There is a similar function, ucnv_convert(),
1368
+ * which has the following limitations:
1369
+ * - it takes charset names, not converter objects, so that
1370
+ * - two converters are opened for each call
1371
+ * - only single-string conversion is possible, not streaming operation
1372
+ * - it does not provide enough information to find out,
1373
+ * in case of failure, whether the toUnicode or
1374
+ * the fromUnicode conversion failed
1375
+ *
1376
+ * By contrast, ucnv_convertEx()
1377
+ * - takes UConverter parameters instead of charset names
1378
+ * - fully exposes the pivot buffer for streaming conversion and complete error handling
1379
+ *
1380
+ * ucnv_convertEx() also provides further convenience:
1381
+ * - an option to reset the converters at the beginning
1382
+ * (if reset==TRUE, see parameters;
1383
+ * also sets *pivotTarget=*pivotSource=pivotStart)
1384
+ * - allow NUL-terminated input
1385
+ * (only a single NUL byte, will not work for charsets with multi-byte NULs)
1386
+ * (if sourceLimit==NULL, see parameters)
1387
+ * - terminate with a NUL on output
1388
+ * (only a single NUL byte, not useful for charsets with multi-byte NULs),
1389
+ * or set U_STRING_NOT_TERMINATED_WARNING if the output exactly fills
1390
+ * the target buffer
1391
+ * - the pivot buffer can be provided internally;
1392
+ * possible only for whole-string conversion, not streaming conversion;
1393
+ * in this case, the caller will not be able to get details about where an
1394
+ * error occurred
1395
+ * (if pivotStart==NULL, see below)
1396
+ *
1397
+ * The function returns when one of the following is true:
1398
+ * - the entire source text has been converted successfully to the target buffer
1399
+ * - a target buffer overflow occurred (U_BUFFER_OVERFLOW_ERROR)
1400
+ * - a conversion error occurred
1401
+ * (other U_FAILURE(), see description of pErrorCode)
1402
+ *
1403
+ * Limitation compared to the direct use of
1404
+ * ucnv_fromUnicode() and ucnv_toUnicode():
1405
+ * ucnv_convertEx() does not provide offset information.
1406
+ *
1407
+ * Limitation compared to ucnv_fromUChars() and ucnv_toUChars():
1408
+ * ucnv_convertEx() does not support preflighting directly.
1409
+ *
1410
+ * Sample code for converting a single string from
1411
+ * one external charset to UTF-8, ignoring the location of errors:
1412
+ *
1413
+ * \code
1414
+ * int32_t
1415
+ * myToUTF8(UConverter *cnv,
1416
+ * const char *s, int32_t length,
1417
+ * char *u8, int32_t capacity,
1418
+ * UErrorCode *pErrorCode) {
1419
+ * UConverter *utf8Cnv;
1420
+ * char *target;
1421
+ *
1422
+ * if(U_FAILURE(*pErrorCode)) {
1423
+ * return 0;
1424
+ * }
1425
+ *
1426
+ * utf8Cnv=myGetCachedUTF8Converter(pErrorCode);
1427
+ * if(U_FAILURE(*pErrorCode)) {
1428
+ * return 0;
1429
+ * }
1430
+ *
1431
+ * if(length<0) {
1432
+ * length=strlen(s);
1433
+ * }
1434
+ * target=u8;
1435
+ * ucnv_convertEx(utf8Cnv, cnv,
1436
+ * &target, u8+capacity,
1437
+ * &s, s+length,
1438
+ * NULL, NULL, NULL, NULL,
1439
+ * TRUE, TRUE,
1440
+ * pErrorCode);
1441
+ *
1442
+ * myReleaseCachedUTF8Converter(utf8Cnv);
1443
+ *
1444
+ * // return the output string length, but without preflighting
1445
+ * return (int32_t)(target-u8);
1446
+ * }
1447
+ * \endcode
1448
+ *
1449
+ * @param targetCnv Output converter, used to convert from the UTF-16 pivot
1450
+ * to the target using ucnv_fromUnicode().
1451
+ * @param sourceCnv Input converter, used to convert from the source to
1452
+ * the UTF-16 pivot using ucnv_toUnicode().
1453
+ * @param target I/O parameter, same as for ucnv_fromUChars().
1454
+ * Input: *target points to the beginning of the target buffer.
1455
+ * Output: *target points to the first unit after the last char written.
1456
+ * @param targetLimit Pointer to the first unit after the target buffer.
1457
+ * @param source I/O parameter, same as for ucnv_toUChars().
1458
+ * Input: *source points to the beginning of the source buffer.
1459
+ * Output: *source points to the first unit after the last char read.
1460
+ * @param sourceLimit Pointer to the first unit after the source buffer.
1461
+ * @param pivotStart Pointer to the UTF-16 pivot buffer. If pivotStart==NULL,
1462
+ * then an internal buffer is used and the other pivot
1463
+ * arguments are ignored and can be NULL as well.
1464
+ * @param pivotSource I/O parameter, same as source in ucnv_fromUChars() for
1465
+ * conversion from the pivot buffer to the target buffer.
1466
+ * @param pivotTarget I/O parameter, same as target in ucnv_toUChars() for
1467
+ * conversion from the source buffer to the pivot buffer.
1468
+ * It must be pivotStart<=*pivotSource<=*pivotTarget<=pivotLimit
1469
+ * and pivotStart<pivotLimit (unless pivotStart==NULL).
1470
+ * @param pivotLimit Pointer to the first unit after the pivot buffer.
1471
+ * @param reset If TRUE, then ucnv_resetToUnicode(sourceCnv) and
1472
+ * ucnv_resetFromUnicode(targetCnv) are called, and the
1473
+ * pivot pointers are reset (*pivotTarget=*pivotSource=pivotStart).
1474
+ * @param flush If true, indicates the end of the input.
1475
+ * Passed directly to ucnv_toUnicode(), and carried over to
1476
+ * ucnv_fromUnicode() when the source is empty as well.
1477
+ * @param pErrorCode ICU error code in/out parameter.
1478
+ * Must fulfill U_SUCCESS before the function call.
1479
+ * U_BUFFER_OVERFLOW_ERROR always refers to the target buffer
1480
+ * because overflows into the pivot buffer are handled internally.
1481
+ * Other conversion errors are from the source-to-pivot
1482
+ * conversion if *pivotSource==pivotStart, otherwise from
1483
+ * the pivot-to-target conversion.
1484
+ *
1485
+ * @see ucnv_convert
1486
+ * @see ucnv_fromAlgorithmic
1487
+ * @see ucnv_toAlgorithmic
1488
+ * @see ucnv_fromUnicode
1489
+ * @see ucnv_toUnicode
1490
+ * @see ucnv_fromUChars
1491
+ * @see ucnv_toUChars
1492
+ * @stable ICU 2.6
1493
+ */
1494
+ U_STABLE void U_EXPORT2
1495
+ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
1496
+ char **target, const char *targetLimit,
1497
+ const char **source, const char *sourceLimit,
1498
+ UChar *pivotStart, UChar **pivotSource,
1499
+ UChar **pivotTarget, const UChar *pivotLimit,
1500
+ UBool reset, UBool flush,
1501
+ UErrorCode *pErrorCode);
1502
+
1503
+ /**
1504
+ * Convert from one external charset to another.
1505
+ * Internally, two converters are opened according to the name arguments,
1506
+ * then the text is converted to and from the 16-bit Unicode "pivot"
1507
+ * using ucnv_convertEx(), then the converters are closed again.
1508
+ *
1509
+ * This is a convenience function, not an efficient way to convert a lot of text:
1510
+ * ucnv_convert()
1511
+ * - takes charset names, not converter objects, so that
1512
+ * - two converters are opened for each call
1513
+ * - only single-string conversion is possible, not streaming operation
1514
+ * - does not provide enough information to find out,
1515
+ * in case of failure, whether the toUnicode or
1516
+ * the fromUnicode conversion failed
1517
+ * - allows NUL-terminated input
1518
+ * (only a single NUL byte, will not work for charsets with multi-byte NULs)
1519
+ * (if sourceLength==-1, see parameters)
1520
+ * - terminate with a NUL on output
1521
+ * (only a single NUL byte, not useful for charsets with multi-byte NULs),
1522
+ * or set U_STRING_NOT_TERMINATED_WARNING if the output exactly fills
1523
+ * the target buffer
1524
+ * - a pivot buffer is provided internally
1525
+ *
1526
+ * The function returns when one of the following is true:
1527
+ * - the entire source text has been converted successfully to the target buffer
1528
+ * and either the target buffer is terminated with a single NUL byte
1529
+ * or the error code is set to U_STRING_NOT_TERMINATED_WARNING
1530
+ * - a target buffer overflow occurred (U_BUFFER_OVERFLOW_ERROR)
1531
+ * and the full output string length is returned ("preflighting")
1532
+ * - a conversion error occurred
1533
+ * (other U_FAILURE(), see description of pErrorCode)
1534
+ *
1535
+ * @param toConverterName The name of the converter that is used to convert
1536
+ * from the UTF-16 pivot buffer to the target.
1537
+ * @param fromConverterName The name of the converter that is used to convert
1538
+ * from the source to the UTF-16 pivot buffer.
1539
+ * @param target Pointer to the output buffer.
1540
+ * @param targetCapacity Capacity of the target, in bytes.
1541
+ * @param source Pointer to the input buffer.
1542
+ * @param sourceLength Length of the input text, in bytes, or -1 for NUL-terminated input.
1543
+ * @param pErrorCode ICU error code in/out parameter.
1544
+ * Must fulfill U_SUCCESS before the function call.
1545
+ * @return Length of the complete output text in bytes, even if it exceeds the targetCapacity
1546
+ * and a U_BUFFER_OVERFLOW_ERROR is set.
1547
+ *
1548
+ * @see ucnv_convertEx
1549
+ * @see ucnv_fromAlgorithmic
1550
+ * @see ucnv_toAlgorithmic
1551
+ * @see ucnv_fromUnicode
1552
+ * @see ucnv_toUnicode
1553
+ * @see ucnv_fromUChars
1554
+ * @see ucnv_toUChars
1555
+ * @see ucnv_getNextUChar
1556
+ * @stable ICU 2.0
1557
+ */
1558
+ U_STABLE int32_t U_EXPORT2
1559
+ ucnv_convert(const char *toConverterName,
1560
+ const char *fromConverterName,
1561
+ char *target,
1562
+ int32_t targetCapacity,
1563
+ const char *source,
1564
+ int32_t sourceLength,
1565
+ UErrorCode *pErrorCode);
1566
+
1567
+ /**
1568
+ * Convert from one external charset to another.
1569
+ * Internally, the text is converted to and from the 16-bit Unicode "pivot"
1570
+ * using ucnv_convertEx(). ucnv_toAlgorithmic() works exactly like ucnv_convert()
1571
+ * except that the two converters need not be looked up and opened completely.
1572
+ *
1573
+ * The source-to-pivot conversion uses the cnv converter parameter.
1574
+ * The pivot-to-target conversion uses a purely algorithmic converter
1575
+ * according to the specified type, e.g., UCNV_UTF8 for a UTF-8 converter.
1576
+ *
1577
+ * Internally, the algorithmic converter is opened and closed for each
1578
+ * function call, which is more efficient than using the public ucnv_open()
1579
+ * but somewhat less efficient than only resetting an existing converter
1580
+ * and using ucnv_convertEx().
1581
+ *
1582
+ * This function is more convenient than ucnv_convertEx() for single-string
1583
+ * conversions, especially when "preflighting" is desired (returning the length
1584
+ * of the complete output even if it does not fit into the target buffer;
1585
+ * see the User Guide Strings chapter). See ucnv_convert() for details.
1586
+ *
1587
+ * @param algorithmicType UConverterType constant identifying the desired target
1588
+ * charset as a purely algorithmic converter.
1589
+ * Those are converters for Unicode charsets like
1590
+ * UTF-8, BOCU-1, SCSU, UTF-7, IMAP-mailbox-name, etc.,
1591
+ * as well as US-ASCII and ISO-8859-1.
1592
+ * @param cnv The converter that is used to convert
1593
+ * from the source to the UTF-16 pivot buffer.
1594
+ * @param target Pointer to the output buffer.
1595
+ * @param targetCapacity Capacity of the target, in bytes.
1596
+ * @param source Pointer to the input buffer.
1597
+ * @param sourceLength Length of the input text, in bytes
1598
+ * @param pErrorCode ICU error code in/out parameter.
1599
+ * Must fulfill U_SUCCESS before the function call.
1600
+ * @return Length of the complete output text in bytes, even if it exceeds the targetCapacity
1601
+ * and a U_BUFFER_OVERFLOW_ERROR is set.
1602
+ *
1603
+ * @see ucnv_fromAlgorithmic
1604
+ * @see ucnv_convert
1605
+ * @see ucnv_convertEx
1606
+ * @see ucnv_fromUnicode
1607
+ * @see ucnv_toUnicode
1608
+ * @see ucnv_fromUChars
1609
+ * @see ucnv_toUChars
1610
+ * @stable ICU 2.6
1611
+ */
1612
+ U_STABLE int32_t U_EXPORT2
1613
+ ucnv_toAlgorithmic(UConverterType algorithmicType,
1614
+ UConverter *cnv,
1615
+ char *target, int32_t targetCapacity,
1616
+ const char *source, int32_t sourceLength,
1617
+ UErrorCode *pErrorCode);
1618
+
1619
+ /**
1620
+ * Convert from one external charset to another.
1621
+ * Internally, the text is converted to and from the 16-bit Unicode "pivot"
1622
+ * using ucnv_convertEx(). ucnv_fromAlgorithmic() works exactly like ucnv_convert()
1623
+ * except that the two converters need not be looked up and opened completely.
1624
+ *
1625
+ * The source-to-pivot conversion uses a purely algorithmic converter
1626
+ * according to the specified type, e.g., UCNV_UTF8 for a UTF-8 converter.
1627
+ * The pivot-to-target conversion uses the cnv converter parameter.
1628
+ *
1629
+ * Internally, the algorithmic converter is opened and closed for each
1630
+ * function call, which is more efficient than using the public ucnv_open()
1631
+ * but somewhat less efficient than only resetting an existing converter
1632
+ * and using ucnv_convertEx().
1633
+ *
1634
+ * This function is more convenient than ucnv_convertEx() for single-string
1635
+ * conversions, especially when "preflighting" is desired (returning the length
1636
+ * of the complete output even if it does not fit into the target buffer;
1637
+ * see the User Guide Strings chapter). See ucnv_convert() for details.
1638
+ *
1639
+ * @param cnv The converter that is used to convert
1640
+ * from the UTF-16 pivot buffer to the target.
1641
+ * @param algorithmicType UConverterType constant identifying the desired source
1642
+ * charset as a purely algorithmic converter.
1643
+ * Those are converters for Unicode charsets like
1644
+ * UTF-8, BOCU-1, SCSU, UTF-7, IMAP-mailbox-name, etc.,
1645
+ * as well as US-ASCII and ISO-8859-1.
1646
+ * @param target Pointer to the output buffer.
1647
+ * @param targetCapacity Capacity of the target, in bytes.
1648
+ * @param source Pointer to the input buffer.
1649
+ * @param sourceLength Length of the input text, in bytes
1650
+ * @param pErrorCode ICU error code in/out parameter.
1651
+ * Must fulfill U_SUCCESS before the function call.
1652
+ * @return Length of the complete output text in bytes, even if it exceeds the targetCapacity
1653
+ * and a U_BUFFER_OVERFLOW_ERROR is set.
1654
+ *
1655
+ * @see ucnv_fromAlgorithmic
1656
+ * @see ucnv_convert
1657
+ * @see ucnv_convertEx
1658
+ * @see ucnv_fromUnicode
1659
+ * @see ucnv_toUnicode
1660
+ * @see ucnv_fromUChars
1661
+ * @see ucnv_toUChars
1662
+ * @stable ICU 2.6
1663
+ */
1664
+ U_STABLE int32_t U_EXPORT2
1665
+ ucnv_fromAlgorithmic(UConverter *cnv,
1666
+ UConverterType algorithmicType,
1667
+ char *target, int32_t targetCapacity,
1668
+ const char *source, int32_t sourceLength,
1669
+ UErrorCode *pErrorCode);
1670
+
1671
+ /**
1672
+ * Frees up memory occupied by unused, cached converter shared data.
1673
+ *
1674
+ * @return the number of cached converters successfully deleted
1675
+ * @see ucnv_close
1676
+ * @stable ICU 2.0
1677
+ */
1678
+ U_STABLE int32_t U_EXPORT2
1679
+ ucnv_flushCache(void);
1680
+
1681
+ /**
1682
+ * Returns the number of available converters, as per the alias file.
1683
+ *
1684
+ * @return the number of available converters
1685
+ * @see ucnv_getAvailableName
1686
+ * @stable ICU 2.0
1687
+ */
1688
+ U_STABLE int32_t U_EXPORT2
1689
+ ucnv_countAvailable(void);
1690
+
1691
+ /**
1692
+ * Gets the canonical converter name of the specified converter from a list of
1693
+ * all available converters contaied in the alias file. All converters
1694
+ * in this list can be opened.
1695
+ *
1696
+ * @param n the index to a converter available on the system (in the range <TT>[0..ucnv_countAvaiable()]</TT>)
1697
+ * @return a pointer a string (library owned), or <TT>NULL</TT> if the index is out of bounds.
1698
+ * @see ucnv_countAvailable
1699
+ * @stable ICU 2.0
1700
+ */
1701
+ U_STABLE const char* U_EXPORT2
1702
+ ucnv_getAvailableName(int32_t n);
1703
+
1704
+ /**
1705
+ * Returns a UEnumeration to enumerate all of the canonical converter
1706
+ * names, as per the alias file, regardless of the ability to open each
1707
+ * converter.
1708
+ *
1709
+ * @return A UEnumeration object for getting all the recognized canonical
1710
+ * converter names.
1711
+ * @see ucnv_getAvailableName
1712
+ * @see uenum_close
1713
+ * @see uenum_next
1714
+ * @stable ICU 2.4
1715
+ */
1716
+ U_STABLE UEnumeration * U_EXPORT2
1717
+ ucnv_openAllNames(UErrorCode *pErrorCode);
1718
+
1719
+ /**
1720
+ * Gives the number of aliases for a given converter or alias name.
1721
+ * If the alias is ambiguous, then the preferred converter is used
1722
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
1723
+ * This method only enumerates the listed entries in the alias file.
1724
+ * @param alias alias name
1725
+ * @param pErrorCode error status
1726
+ * @return number of names on alias list for given alias
1727
+ * @stable ICU 2.0
1728
+ */
1729
+ U_STABLE uint16_t U_EXPORT2
1730
+ ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
1731
+
1732
+ /**
1733
+ * Gives the name of the alias at given index of alias list.
1734
+ * This method only enumerates the listed entries in the alias file.
1735
+ * If the alias is ambiguous, then the preferred converter is used
1736
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
1737
+ * @param alias alias name
1738
+ * @param n index in alias list
1739
+ * @param pErrorCode result of operation
1740
+ * @return returns the name of the alias at given index
1741
+ * @see ucnv_countAliases
1742
+ * @stable ICU 2.0
1743
+ */
1744
+ U_STABLE const char * U_EXPORT2
1745
+ ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1746
+
1747
+ /**
1748
+ * Fill-up the list of alias names for the given alias.
1749
+ * This method only enumerates the listed entries in the alias file.
1750
+ * If the alias is ambiguous, then the preferred converter is used
1751
+ * and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
1752
+ * @param alias alias name
1753
+ * @param aliases fill-in list, aliases is a pointer to an array of
1754
+ * <code>ucnv_countAliases()</code> string-pointers
1755
+ * (<code>const char *</code>) that will be filled in.
1756
+ * The strings themselves are owned by the library.
1757
+ * @param pErrorCode result of operation
1758
+ * @stable ICU 2.0
1759
+ */
1760
+ U_STABLE void U_EXPORT2
1761
+ ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
1762
+
1763
+ /**
1764
+ * Return a new UEnumeration object for enumerating all the
1765
+ * alias names for a given converter that are recognized by a standard.
1766
+ * This method only enumerates the listed entries in the alias file.
1767
+ * The convrtrs.txt file can be modified to change the results of
1768
+ * this function.
1769
+ * The first result in this list is the same result given by
1770
+ * <code>ucnv_getStandardName</code>, which is the default alias for
1771
+ * the specified standard name. The returned object must be closed with
1772
+ * <code>uenum_close</code> when you are done with the object.
1773
+ *
1774
+ * @param convName original converter name
1775
+ * @param standard name of the standard governing the names; MIME and IANA
1776
+ * are such standards
1777
+ * @param pErrorCode The error code
1778
+ * @return A UEnumeration object for getting all aliases that are recognized
1779
+ * by a standard. If any of the parameters are invalid, NULL
1780
+ * is returned.
1781
+ * @see ucnv_getStandardName
1782
+ * @see uenum_close
1783
+ * @see uenum_next
1784
+ * @stable ICU 2.2
1785
+ */
1786
+ U_STABLE UEnumeration * U_EXPORT2
1787
+ ucnv_openStandardNames(const char *convName,
1788
+ const char *standard,
1789
+ UErrorCode *pErrorCode);
1790
+
1791
+ /**
1792
+ * Gives the number of standards associated to converter names.
1793
+ * @return number of standards
1794
+ * @stable ICU 2.0
1795
+ */
1796
+ U_STABLE uint16_t U_EXPORT2
1797
+ ucnv_countStandards(void);
1798
+
1799
+ /**
1800
+ * Gives the name of the standard at given index of standard list.
1801
+ * @param n index in standard list
1802
+ * @param pErrorCode result of operation
1803
+ * @return returns the name of the standard at given index. Owned by the library.
1804
+ * @stable ICU 2.0
1805
+ */
1806
+ U_STABLE const char * U_EXPORT2
1807
+ ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode);
1808
+
1809
+ /**
1810
+ * Returns a standard name for a given converter name.
1811
+ * <p>
1812
+ * Example alias table:<br>
1813
+ * conv alias1 { STANDARD1 } alias2 { STANDARD1* }
1814
+ * <p>
1815
+ * Result of ucnv_getStandardName("conv", "STANDARD1") from example
1816
+ * alias table:<br>
1817
+ * <b>"alias2"</b>
1818
+ *
1819
+ * @param name original converter name
1820
+ * @param standard name of the standard governing the names; MIME and IANA
1821
+ * are such standards
1822
+ * @param pErrorCode result of operation
1823
+ * @return returns the standard converter name;
1824
+ * if a standard converter name cannot be determined,
1825
+ * then <code>NULL</code> is returned. Owned by the library.
1826
+ * @stable ICU 2.0
1827
+ */
1828
+ U_STABLE const char * U_EXPORT2
1829
+ ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode);
1830
+
1831
+ /**
1832
+ * This function will return the internal canonical converter name of the
1833
+ * tagged alias. This is the opposite of ucnv_openStandardNames, which
1834
+ * returns the tagged alias given the canonical name.
1835
+ * <p>
1836
+ * Example alias table:<br>
1837
+ * conv alias1 { STANDARD1 } alias2 { STANDARD1* }
1838
+ * <p>
1839
+ * Result of ucnv_getStandardName("alias1", "STANDARD1") from example
1840
+ * alias table:<br>
1841
+ * <b>"conv"</b>
1842
+ *
1843
+ * @return returns the canonical converter name;
1844
+ * if a standard or alias name cannot be determined,
1845
+ * then <code>NULL</code> is returned. The returned string is
1846
+ * owned by the library.
1847
+ * @see ucnv_getStandardName
1848
+ * @stable ICU 2.4
1849
+ */
1850
+ U_STABLE const char * U_EXPORT2
1851
+ ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
1852
+
1853
+ /**
1854
+ * Returns the current default converter name. If you want to open
1855
+ * a default converter, you do not need to use this function.
1856
+ * It is faster if you pass a NULL argument to ucnv_open the
1857
+ * default converter.
1858
+ *
1859
+ * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function
1860
+ * always returns "UTF-8".
1861
+ *
1862
+ * @return returns the current default converter name.
1863
+ * Storage owned by the library
1864
+ * @see ucnv_setDefaultName
1865
+ * @stable ICU 2.0
1866
+ */
1867
+ U_STABLE const char * U_EXPORT2
1868
+ ucnv_getDefaultName(void);
1869
+
1870
+ #ifndef U_HIDE_SYSTEM_API
1871
+ /**
1872
+ * This function is not thread safe. DO NOT call this function when ANY ICU
1873
+ * function is being used from more than one thread! This function sets the
1874
+ * current default converter name. If this function needs to be called, it
1875
+ * should be called during application initialization. Most of the time, the
1876
+ * results from ucnv_getDefaultName() or ucnv_open with a NULL string argument
1877
+ * is sufficient for your application.
1878
+ *
1879
+ * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function
1880
+ * does nothing.
1881
+ *
1882
+ * @param name the converter name to be the default (must be known by ICU).
1883
+ * @see ucnv_getDefaultName
1884
+ * @system
1885
+ * @stable ICU 2.0
1886
+ */
1887
+ U_STABLE void U_EXPORT2
1888
+ ucnv_setDefaultName(const char *name);
1889
+ #endif /* U_HIDE_SYSTEM_API */
1890
+
1891
+ /**
1892
+ * Fixes the backslash character mismapping. For example, in SJIS, the backslash
1893
+ * character in the ASCII portion is also used to represent the yen currency sign.
1894
+ * When mapping from Unicode character 0x005C, it's unclear whether to map the
1895
+ * character back to yen or backslash in SJIS. This function will take the input
1896
+ * buffer and replace all the yen sign characters with backslash. This is necessary
1897
+ * when the user tries to open a file with the input buffer on Windows.
1898
+ * This function will test the converter to see whether such mapping is
1899
+ * required. You can sometimes avoid using this function by using the correct version
1900
+ * of Shift-JIS.
1901
+ *
1902
+ * @param cnv The converter representing the target codepage.
1903
+ * @param source the input buffer to be fixed
1904
+ * @param sourceLen the length of the input buffer
1905
+ * @see ucnv_isAmbiguous
1906
+ * @stable ICU 2.0
1907
+ */
1908
+ U_STABLE void U_EXPORT2
1909
+ ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen);
1910
+
1911
+ /**
1912
+ * Determines if the converter contains ambiguous mappings of the same
1913
+ * character or not.
1914
+ * @param cnv the converter to be tested
1915
+ * @return TRUE if the converter contains ambiguous mapping of the same
1916
+ * character, FALSE otherwise.
1917
+ * @stable ICU 2.0
1918
+ */
1919
+ U_STABLE UBool U_EXPORT2
1920
+ ucnv_isAmbiguous(const UConverter *cnv);
1921
+
1922
+ /**
1923
+ * Sets the converter to use fallback mappings or not.
1924
+ * Regardless of this flag, the converter will always use
1925
+ * fallbacks from Unicode Private Use code points, as well as
1926
+ * reverse fallbacks (to Unicode).
1927
+ * For details see ".ucm File Format"
1928
+ * in the Conversion Data chapter of the ICU User Guide:
1929
+ * http://www.icu-project.org/userguide/conversion-data.html#ucmformat
1930
+ *
1931
+ * @param cnv The converter to set the fallback mapping usage on.
1932
+ * @param usesFallback TRUE if the user wants the converter to take advantage of the fallback
1933
+ * mapping, FALSE otherwise.
1934
+ * @stable ICU 2.0
1935
+ * @see ucnv_usesFallback
1936
+ */
1937
+ U_STABLE void U_EXPORT2
1938
+ ucnv_setFallback(UConverter *cnv, UBool usesFallback);
1939
+
1940
+ /**
1941
+ * Determines if the converter uses fallback mappings or not.
1942
+ * This flag has restrictions, see ucnv_setFallback().
1943
+ *
1944
+ * @param cnv The converter to be tested
1945
+ * @return TRUE if the converter uses fallback, FALSE otherwise.
1946
+ * @stable ICU 2.0
1947
+ * @see ucnv_setFallback
1948
+ */
1949
+ U_STABLE UBool U_EXPORT2
1950
+ ucnv_usesFallback(const UConverter *cnv);
1951
+
1952
+ /**
1953
+ * Detects Unicode signature byte sequences at the start of the byte stream
1954
+ * and returns the charset name of the indicated Unicode charset.
1955
+ * NULL is returned when no Unicode signature is recognized.
1956
+ * The number of bytes in the signature is output as well.
1957
+ *
1958
+ * The caller can ucnv_open() a converter using the charset name.
1959
+ * The first code unit (UChar) from the start of the stream will be U+FEFF
1960
+ * (the Unicode BOM/signature character) and can usually be ignored.
1961
+ *
1962
+ * For most Unicode charsets it is also possible to ignore the indicated
1963
+ * number of initial stream bytes and start converting after them.
1964
+ * However, there are stateful Unicode charsets (UTF-7 and BOCU-1) for which
1965
+ * this will not work. Therefore, it is best to ignore the first output UChar
1966
+ * instead of the input signature bytes.
1967
+ * <p>
1968
+ * Usage:
1969
+ * \snippet samples/ucnv/convsamp.cpp ucnv_detectUnicodeSignature
1970
+ *
1971
+ * @param source The source string in which the signature should be detected.
1972
+ * @param sourceLength Length of the input string, or -1 if terminated with a NUL byte.
1973
+ * @param signatureLength A pointer to int32_t to receive the number of bytes that make up the signature
1974
+ * of the detected UTF. 0 if not detected.
1975
+ * Can be a NULL pointer.
1976
+ * @param pErrorCode ICU error code in/out parameter.
1977
+ * Must fulfill U_SUCCESS before the function call.
1978
+ * @return The name of the encoding detected. NULL if encoding is not detected.
1979
+ * @stable ICU 2.4
1980
+ */
1981
+ U_STABLE const char* U_EXPORT2
1982
+ ucnv_detectUnicodeSignature(const char* source,
1983
+ int32_t sourceLength,
1984
+ int32_t *signatureLength,
1985
+ UErrorCode *pErrorCode);
1986
+
1987
+ /**
1988
+ * Returns the number of UChars held in the converter's internal state
1989
+ * because more input is needed for completing the conversion. This function is
1990
+ * useful for mapping semantics of ICU's converter interface to those of iconv,
1991
+ * and this information is not needed for normal conversion.
1992
+ * @param cnv The converter in which the input is held
1993
+ * @param status ICU error code in/out parameter.
1994
+ * Must fulfill U_SUCCESS before the function call.
1995
+ * @return The number of UChars in the state. -1 if an error is encountered.
1996
+ * @stable ICU 3.4
1997
+ */
1998
+ U_STABLE int32_t U_EXPORT2
1999
+ ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status);
2000
+
2001
+ /**
2002
+ * Returns the number of chars held in the converter's internal state
2003
+ * because more input is needed for completing the conversion. This function is
2004
+ * useful for mapping semantics of ICU's converter interface to those of iconv,
2005
+ * and this information is not needed for normal conversion.
2006
+ * @param cnv The converter in which the input is held as internal state
2007
+ * @param status ICU error code in/out parameter.
2008
+ * Must fulfill U_SUCCESS before the function call.
2009
+ * @return The number of chars in the state. -1 if an error is encountered.
2010
+ * @stable ICU 3.4
2011
+ */
2012
+ U_STABLE int32_t U_EXPORT2
2013
+ ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status);
2014
+
2015
+ /**
2016
+ * Returns whether or not the charset of the converter has a fixed number of bytes
2017
+ * per charset character.
2018
+ * An example of this are converters that are of the type UCNV_SBCS or UCNV_DBCS.
2019
+ * Another example is UTF-32 which is always 4 bytes per character.
2020
+ * A Unicode code point may be represented by more than one UTF-8 or UTF-16 code unit
2021
+ * but a UTF-32 converter encodes each code point with 4 bytes.
2022
+ * Note: This method is not intended to be used to determine whether the charset has a
2023
+ * fixed ratio of bytes to Unicode codes <i>units</i> for any particular Unicode encoding form.
2024
+ * FALSE is returned with the UErrorCode if error occurs or cnv is NULL.
2025
+ * @param cnv The converter to be tested
2026
+ * @param status ICU error code in/out paramter
2027
+ * @return TRUE if the converter is fixed-width
2028
+ * @stable ICU 4.8
2029
+ */
2030
+ U_STABLE UBool U_EXPORT2
2031
+ ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status);
2032
+
2033
+ #endif
2034
+
2035
+ #endif
2036
+ /*_UCNV*/