nsUConvModule.cpp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "mozilla/ModuleUtils.h"
  6. #include "nsEncoderDecoderUtils.h"
  7. #include "nsIUnicodeDecoder.h"
  8. #include "nsIUnicodeEncoder.h"
  9. #include "nsUConvCID.h"
  10. #include "nsTextToSubURI.h"
  11. #include "nsUTF8ConverterService.h"
  12. #include "nsConverterInputStream.h"
  13. #include "nsConverterOutputStream.h"
  14. #include "nsScriptableUConv.h"
  15. #include "nsIOutputStream.h"
  16. #include "nsITextToSubURI.h"
  17. #include "nsISO88591ToUnicode.h"
  18. #include "nsCP1252ToUnicode.h"
  19. #include "nsMacRomanToUnicode.h"
  20. #include "nsReplacementToUnicode.h"
  21. #include "nsUTF8ToUnicode.h"
  22. #include "nsUnicodeToISO88591.h"
  23. #include "nsUnicodeToCP1252.h"
  24. #include "nsUnicodeToMacRoman.h"
  25. #include "nsUnicodeToUTF8.h"
  26. // ucvlatin
  27. #include "nsUCvLatinCID.h"
  28. #include "nsISO88592ToUnicode.h"
  29. #include "nsISO88593ToUnicode.h"
  30. #include "nsISO88594ToUnicode.h"
  31. #include "nsISO88595ToUnicode.h"
  32. #include "nsISO88596ToUnicode.h"
  33. #include "nsISO88597ToUnicode.h"
  34. #include "nsISO88598ToUnicode.h"
  35. #include "nsISO88598IToUnicode.h"
  36. #include "nsISO885910ToUnicode.h"
  37. #include "nsISO885913ToUnicode.h"
  38. #include "nsISO885914ToUnicode.h"
  39. #include "nsISO885915ToUnicode.h"
  40. #include "nsISO885916ToUnicode.h"
  41. #include "nsCP1250ToUnicode.h"
  42. #include "nsCP1251ToUnicode.h"
  43. #include "nsCP1253ToUnicode.h"
  44. #include "nsCP1254ToUnicode.h"
  45. #include "nsCP1255ToUnicode.h"
  46. #include "nsCP1256ToUnicode.h"
  47. #include "nsCP1257ToUnicode.h"
  48. #include "nsCP1258ToUnicode.h"
  49. #include "nsCP874ToUnicode.h"
  50. #include "nsCP866ToUnicode.h"
  51. #include "nsKOI8RToUnicode.h"
  52. #include "nsKOI8UToUnicode.h"
  53. #include "nsMacCEToUnicode.h"
  54. #include "nsMacGreekToUnicode.h"
  55. #include "nsMacTurkishToUnicode.h"
  56. #include "nsMacCroatianToUnicode.h"
  57. #include "nsMacRomanianToUnicode.h"
  58. #include "nsMacCyrillicToUnicode.h"
  59. #include "nsMacIcelandicToUnicode.h"
  60. #include "nsUTF16ToUnicode.h"
  61. #include "nsUserDefinedToUnicode.h"
  62. #include "nsUnicodeToISO88592.h"
  63. #include "nsUnicodeToISO88593.h"
  64. #include "nsUnicodeToISO88594.h"
  65. #include "nsUnicodeToISO88595.h"
  66. #include "nsUnicodeToISO88596.h"
  67. #include "nsUnicodeToISO88597.h"
  68. #include "nsUnicodeToISO88598.h"
  69. #include "nsUnicodeToISO88598I.h"
  70. #include "nsUnicodeToISO885910.h"
  71. #include "nsUnicodeToISO885913.h"
  72. #include "nsUnicodeToISO885914.h"
  73. #include "nsUnicodeToISO885915.h"
  74. #include "nsUnicodeToISO885916.h"
  75. #include "nsUnicodeToCP1250.h"
  76. #include "nsUnicodeToCP1251.h"
  77. #include "nsUnicodeToCP1253.h"
  78. #include "nsUnicodeToCP1254.h"
  79. #include "nsUnicodeToCP1255.h"
  80. #include "nsUnicodeToCP1256.h"
  81. #include "nsUnicodeToCP1257.h"
  82. #include "nsUnicodeToCP1258.h"
  83. #include "nsUnicodeToCP874.h"
  84. #include "nsUnicodeToCP866.h"
  85. #include "nsUnicodeToKOI8R.h"
  86. #include "nsUnicodeToKOI8U.h"
  87. #include "nsUnicodeToMacCyrillic.h"
  88. #include "nsUnicodeToUTF16.h"
  89. #include "nsUnicodeToUserDefined.h"
  90. #include "nsMacArabicToUnicode.h"
  91. #include "nsMacDevanagariToUnicode.h"
  92. #include "nsMacFarsiToUnicode.h"
  93. #include "nsMacGujaratiToUnicode.h"
  94. #include "nsMacGurmukhiToUnicode.h"
  95. #include "nsMacHebrewToUnicode.h"
  96. // ucvja
  97. #include "nsUCVJACID.h"
  98. #include "nsUCVJA2CID.h"
  99. #include "nsUCVJADll.h"
  100. #include "nsJapaneseToUnicode.h"
  101. #include "nsUnicodeToSJIS.h"
  102. #include "nsUnicodeToEUCJP.h"
  103. #include "nsUnicodeToISO2022JP.h"
  104. // ucvtw
  105. #include "nsBIG5ToUnicode.h"
  106. #include "nsUnicodeToBIG5.h"
  107. // ucvko
  108. #include "nsUCvKOCID.h"
  109. #include "nsUCvKODll.h"
  110. #include "nsCP949ToUnicode.h"
  111. #include "nsUnicodeToCP949.h"
  112. // ucvcn
  113. #include "nsUCvCnCID.h"
  114. #include "nsGBKToUnicode.h"
  115. #include "nsUnicodeToGBK.h"
  116. #include "gbku.h"
  117. NS_CONVERTER_REGISTRY_START
  118. NS_UCONV_REG_UNREG("ISO-8859-1", NS_ISO88591TOUNICODE_CID, NS_UNICODETOISO88591_CID)
  119. NS_UCONV_REG_UNREG("windows-1252", NS_CP1252TOUNICODE_CID, NS_UNICODETOCP1252_CID)
  120. NS_UCONV_REG_UNREG("macintosh", NS_MACROMANTOUNICODE_CID, NS_UNICODETOMACROMAN_CID)
  121. NS_UCONV_REG_UNREG("UTF-8", NS_UTF8TOUNICODE_CID, NS_UNICODETOUTF8_CID)
  122. NS_UCONV_REG_UNREG("replacement", NS_REPLACEMENTTOUNICODE_CID, NS_UNICODETOUTF8_CID)
  123. // ucvlatin
  124. NS_UCONV_REG_UNREG("ISO-8859-2", NS_ISO88592TOUNICODE_CID, NS_UNICODETOISO88592_CID)
  125. NS_UCONV_REG_UNREG("ISO-8859-3", NS_ISO88593TOUNICODE_CID, NS_UNICODETOISO88593_CID)
  126. NS_UCONV_REG_UNREG("ISO-8859-4", NS_ISO88594TOUNICODE_CID, NS_UNICODETOISO88594_CID)
  127. NS_UCONV_REG_UNREG("ISO-8859-5", NS_ISO88595TOUNICODE_CID, NS_UNICODETOISO88595_CID)
  128. NS_UCONV_REG_UNREG("ISO-8859-6", NS_ISO88596TOUNICODE_CID, NS_UNICODETOISO88596_CID)
  129. NS_UCONV_REG_UNREG("ISO-8859-7", NS_ISO88597TOUNICODE_CID, NS_UNICODETOISO88597_CID)
  130. NS_UCONV_REG_UNREG("ISO-8859-8", NS_ISO88598TOUNICODE_CID, NS_UNICODETOISO88598_CID)
  131. NS_UCONV_REG_UNREG("ISO-8859-8-I", NS_ISO88598ITOUNICODE_CID, NS_UNICODETOISO88598I_CID)
  132. NS_UCONV_REG_UNREG("ISO-8859-10", NS_ISO885910TOUNICODE_CID, NS_UNICODETOISO885910_CID)
  133. NS_UCONV_REG_UNREG("ISO-8859-13", NS_ISO885913TOUNICODE_CID, NS_UNICODETOISO885913_CID)
  134. NS_UCONV_REG_UNREG("ISO-8859-14", NS_ISO885914TOUNICODE_CID, NS_UNICODETOISO885914_CID)
  135. NS_UCONV_REG_UNREG("ISO-8859-15", NS_ISO885915TOUNICODE_CID, NS_UNICODETOISO885915_CID)
  136. NS_UCONV_REG_UNREG("ISO-8859-16", NS_ISO885916TOUNICODE_CID, NS_UNICODETOISO885916_CID)
  137. NS_UCONV_REG_UNREG("windows-1250", NS_CP1250TOUNICODE_CID, NS_UNICODETOCP1250_CID)
  138. NS_UCONV_REG_UNREG("windows-1251", NS_CP1251TOUNICODE_CID, NS_UNICODETOCP1251_CID)
  139. NS_UCONV_REG_UNREG("windows-1253", NS_CP1253TOUNICODE_CID, NS_UNICODETOCP1253_CID)
  140. NS_UCONV_REG_UNREG("windows-1254", NS_CP1254TOUNICODE_CID, NS_UNICODETOCP1254_CID)
  141. NS_UCONV_REG_UNREG("windows-1255", NS_CP1255TOUNICODE_CID, NS_UNICODETOCP1255_CID)
  142. NS_UCONV_REG_UNREG("windows-1256", NS_CP1256TOUNICODE_CID, NS_UNICODETOCP1256_CID)
  143. NS_UCONV_REG_UNREG("windows-1257", NS_CP1257TOUNICODE_CID, NS_UNICODETOCP1257_CID)
  144. NS_UCONV_REG_UNREG("windows-1258", NS_CP1258TOUNICODE_CID, NS_UNICODETOCP1258_CID)
  145. NS_UCONV_REG_UNREG("windows-874", NS_CP874TOUNICODE_CID, NS_UNICODETOCP874_CID)
  146. NS_UCONV_REG_UNREG("IBM866", NS_CP866TOUNICODE_CID, NS_UNICODETOCP866_CID)
  147. NS_UCONV_REG_UNREG("KOI8-R", NS_KOI8RTOUNICODE_CID, NS_UNICODETOKOI8R_CID)
  148. NS_UCONV_REG_UNREG("KOI8-U", NS_KOI8UTOUNICODE_CID, NS_UNICODETOKOI8U_CID)
  149. NS_UCONV_REG_UNREG_DECODER("x-mac-ce", NS_MACCETOUNICODE_CID)
  150. NS_UCONV_REG_UNREG_DECODER("x-mac-greek", NS_MACGREEKTOUNICODE_CID)
  151. NS_UCONV_REG_UNREG_DECODER("x-mac-turkish", NS_MACTURKISHTOUNICODE_CID)
  152. NS_UCONV_REG_UNREG_DECODER("x-mac-croatian", NS_MACCROATIANTOUNICODE_CID)
  153. NS_UCONV_REG_UNREG_DECODER("x-mac-romanian", NS_MACROMANIANTOUNICODE_CID)
  154. NS_UCONV_REG_UNREG("x-mac-cyrillic", NS_MACCYRILLICTOUNICODE_CID, NS_UNICODETOMACCYRILLIC_CID)
  155. NS_UCONV_REG_UNREG_DECODER("x-mac-icelandic", NS_MACICELANDICTOUNICODE_CID)
  156. NS_UCONV_REG_UNREG("UTF-16", NS_UTF16TOUNICODE_CID, NS_UNICODETOUTF16_CID)
  157. NS_UCONV_REG_UNREG("UTF-16BE", NS_UTF16BETOUNICODE_CID, NS_UNICODETOUTF16BE_CID)
  158. NS_UCONV_REG_UNREG("UTF-16LE", NS_UTF16LETOUNICODE_CID, NS_UNICODETOUTF16LE_CID)
  159. NS_UCONV_REG_UNREG("x-user-defined", NS_USERDEFINEDTOUNICODE_CID, NS_UNICODETOUSERDEFINED_CID)
  160. NS_UCONV_REG_UNREG_DECODER("x-mac-arabic" , NS_MACARABICTOUNICODE_CID)
  161. NS_UCONV_REG_UNREG_DECODER("x-mac-devanagari" , NS_MACDEVANAGARITOUNICODE_CID)
  162. NS_UCONV_REG_UNREG_DECODER("x-mac-farsi" , NS_MACFARSITOUNICODE_CID)
  163. NS_UCONV_REG_UNREG_DECODER("x-mac-gurmukhi" , NS_MACGURMUKHITOUNICODE_CID)
  164. NS_UCONV_REG_UNREG_DECODER("x-mac-gujarati" , NS_MACGUJARATITOUNICODE_CID)
  165. NS_UCONV_REG_UNREG_DECODER("x-mac-hebrew" , NS_MACHEBREWTOUNICODE_CID)
  166. // ucvja
  167. NS_UCONV_REG_UNREG("Shift_JIS", NS_SJISTOUNICODE_CID, NS_UNICODETOSJIS_CID)
  168. NS_UCONV_REG_UNREG("ISO-2022-JP", NS_ISO2022JPTOUNICODE_CID, NS_UNICODETOISO2022JP_CID)
  169. NS_UCONV_REG_UNREG("EUC-JP", NS_EUCJPTOUNICODE_CID, NS_UNICODETOEUCJP_CID)
  170. // ucvtw
  171. NS_UCONV_REG_UNREG("Big5", NS_BIG5TOUNICODE_CID, NS_UNICODETOBIG5_CID)
  172. // ucvko
  173. NS_UCONV_REG_UNREG("EUC-KR", NS_EUCKRTOUNICODE_CID, NS_UNICODETOEUCKR_CID)
  174. // ucvcn
  175. NS_UCONV_REG_UNREG("gbk", NS_GBKTOUNICODE_CID, NS_UNICODETOGBK_CID)
  176. NS_UCONV_REG_UNREG("gb18030", NS_GB18030TOUNICODE_CID, NS_UNICODETOGB18030_CID)
  177. NS_CONVERTER_REGISTRY_END
  178. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToUTF8)
  179. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF8ToUnicode)
  180. NS_GENERIC_FACTORY_CONSTRUCTOR(nsReplacementToUnicode)
  181. // ucvlatin
  182. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF16ToUnicode)
  183. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF16BEToUnicode)
  184. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF16LEToUnicode)
  185. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToUTF16BE)
  186. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToUTF16LE)
  187. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToUTF16)
  188. // ucvja
  189. NS_GENERIC_FACTORY_CONSTRUCTOR(nsShiftJISToUnicode)
  190. NS_GENERIC_FACTORY_CONSTRUCTOR(nsEUCJPToUnicodeV2)
  191. NS_GENERIC_FACTORY_CONSTRUCTOR(nsISO2022JPToUnicodeV2)
  192. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToISO2022JP)
  193. // ucvtw
  194. NS_GENERIC_FACTORY_CONSTRUCTOR(nsBIG5ToUnicode)
  195. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToBIG5)
  196. // ucvko
  197. // ucvcn
  198. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToGBK)
  199. NS_GENERIC_FACTORY_CONSTRUCTOR(nsGB18030ToUnicode)
  200. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToGB18030)
  201. //----------------------------------------------------------------------------
  202. // Global functions and data [declaration]
  203. // ucvja
  204. const uint16_t g_uf0201Mapping[] = {
  205. #include "jis0201.uf"
  206. };
  207. const uint16_t g_uf0201GLMapping[] = {
  208. #include "jis0201gl.uf"
  209. };
  210. const uint16_t g_uf0208Mapping[] = {
  211. #include "jis0208.uf"
  212. };
  213. const uint16_t g_uf0208extMapping[] = {
  214. #include "jis0208ext.uf"
  215. };
  216. const uint16_t g_ASCIIMappingTable[] = {
  217. 0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
  218. };
  219. // ucvko
  220. const uint16_t g_utKSC5601Mapping[] = {
  221. #include "u20kscgl.ut"
  222. };
  223. const uint16_t g_ufKSC5601Mapping[] = {
  224. #include "u20kscgl.uf"
  225. };
  226. const uint16_t g_HangulNullMapping[] ={
  227. 0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
  228. };
  229. NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextToSubURI)
  230. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF8ConverterService)
  231. NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterInputStream)
  232. NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterOutputStream)
  233. NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableUnicodeConverter)
  234. NS_DEFINE_NAMED_CID(NS_TEXTTOSUBURI_CID);
  235. NS_DEFINE_NAMED_CID(NS_CONVERTERINPUTSTREAM_CID);
  236. NS_DEFINE_NAMED_CID(NS_CONVERTEROUTPUTSTREAM_CID);
  237. NS_DEFINE_NAMED_CID(NS_ISCRIPTABLEUNICODECONVERTER_CID);
  238. NS_DEFINE_NAMED_CID(NS_UTF8CONVERTERSERVICE_CID);
  239. NS_DEFINE_NAMED_CID(NS_ISO88591TOUNICODE_CID);
  240. NS_DEFINE_NAMED_CID(NS_CP1252TOUNICODE_CID);
  241. NS_DEFINE_NAMED_CID(NS_MACROMANTOUNICODE_CID);
  242. NS_DEFINE_NAMED_CID(NS_UTF8TOUNICODE_CID);
  243. NS_DEFINE_NAMED_CID(NS_REPLACEMENTTOUNICODE_CID);
  244. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88591_CID);
  245. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1252_CID);
  246. NS_DEFINE_NAMED_CID(NS_UNICODETOMACROMAN_CID);
  247. NS_DEFINE_NAMED_CID(NS_UNICODETOUTF8_CID);
  248. NS_DEFINE_NAMED_CID(NS_ISO88592TOUNICODE_CID);
  249. NS_DEFINE_NAMED_CID(NS_ISO88593TOUNICODE_CID);
  250. NS_DEFINE_NAMED_CID(NS_ISO88594TOUNICODE_CID);
  251. NS_DEFINE_NAMED_CID(NS_ISO88595TOUNICODE_CID);
  252. NS_DEFINE_NAMED_CID(NS_ISO88596TOUNICODE_CID);
  253. NS_DEFINE_NAMED_CID(NS_ISO88597TOUNICODE_CID);
  254. NS_DEFINE_NAMED_CID(NS_ISO88598TOUNICODE_CID);
  255. NS_DEFINE_NAMED_CID(NS_ISO88598ITOUNICODE_CID);
  256. NS_DEFINE_NAMED_CID(NS_ISO885910TOUNICODE_CID);
  257. NS_DEFINE_NAMED_CID(NS_ISO885913TOUNICODE_CID);
  258. NS_DEFINE_NAMED_CID(NS_ISO885914TOUNICODE_CID);
  259. NS_DEFINE_NAMED_CID(NS_ISO885915TOUNICODE_CID);
  260. NS_DEFINE_NAMED_CID(NS_ISO885916TOUNICODE_CID);
  261. NS_DEFINE_NAMED_CID(NS_CP1250TOUNICODE_CID);
  262. NS_DEFINE_NAMED_CID(NS_CP1251TOUNICODE_CID);
  263. NS_DEFINE_NAMED_CID(NS_CP1253TOUNICODE_CID);
  264. NS_DEFINE_NAMED_CID(NS_CP1254TOUNICODE_CID);
  265. NS_DEFINE_NAMED_CID(NS_CP1255TOUNICODE_CID);
  266. NS_DEFINE_NAMED_CID(NS_CP1256TOUNICODE_CID);
  267. NS_DEFINE_NAMED_CID(NS_CP1257TOUNICODE_CID);
  268. NS_DEFINE_NAMED_CID(NS_CP1258TOUNICODE_CID);
  269. NS_DEFINE_NAMED_CID(NS_CP874TOUNICODE_CID);
  270. NS_DEFINE_NAMED_CID(NS_CP866TOUNICODE_CID);
  271. NS_DEFINE_NAMED_CID(NS_KOI8RTOUNICODE_CID);
  272. NS_DEFINE_NAMED_CID(NS_KOI8UTOUNICODE_CID);
  273. NS_DEFINE_NAMED_CID(NS_MACCETOUNICODE_CID);
  274. NS_DEFINE_NAMED_CID(NS_MACGREEKTOUNICODE_CID);
  275. NS_DEFINE_NAMED_CID(NS_MACTURKISHTOUNICODE_CID);
  276. NS_DEFINE_NAMED_CID(NS_MACCROATIANTOUNICODE_CID);
  277. NS_DEFINE_NAMED_CID(NS_MACROMANIANTOUNICODE_CID);
  278. NS_DEFINE_NAMED_CID(NS_MACCYRILLICTOUNICODE_CID);
  279. NS_DEFINE_NAMED_CID(NS_MACICELANDICTOUNICODE_CID);
  280. NS_DEFINE_NAMED_CID(NS_UTF16TOUNICODE_CID);
  281. NS_DEFINE_NAMED_CID(NS_UTF16BETOUNICODE_CID);
  282. NS_DEFINE_NAMED_CID(NS_UTF16LETOUNICODE_CID);
  283. NS_DEFINE_NAMED_CID(NS_USERDEFINEDTOUNICODE_CID);
  284. NS_DEFINE_NAMED_CID(NS_MACARABICTOUNICODE_CID);
  285. NS_DEFINE_NAMED_CID(NS_MACDEVANAGARITOUNICODE_CID);
  286. NS_DEFINE_NAMED_CID(NS_MACFARSITOUNICODE_CID);
  287. NS_DEFINE_NAMED_CID(NS_MACGURMUKHITOUNICODE_CID);
  288. NS_DEFINE_NAMED_CID(NS_MACGUJARATITOUNICODE_CID);
  289. NS_DEFINE_NAMED_CID(NS_MACHEBREWTOUNICODE_CID);
  290. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88592_CID);
  291. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88593_CID);
  292. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88594_CID);
  293. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88595_CID);
  294. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88596_CID);
  295. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88597_CID);
  296. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88598_CID);
  297. NS_DEFINE_NAMED_CID(NS_UNICODETOISO88598I_CID);
  298. NS_DEFINE_NAMED_CID(NS_UNICODETOISO885910_CID);
  299. NS_DEFINE_NAMED_CID(NS_UNICODETOISO885913_CID);
  300. NS_DEFINE_NAMED_CID(NS_UNICODETOISO885914_CID);
  301. NS_DEFINE_NAMED_CID(NS_UNICODETOISO885915_CID);
  302. NS_DEFINE_NAMED_CID(NS_UNICODETOISO885916_CID);
  303. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1250_CID);
  304. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1251_CID);
  305. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1253_CID);
  306. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1254_CID);
  307. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1255_CID);
  308. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1256_CID);
  309. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1257_CID);
  310. NS_DEFINE_NAMED_CID(NS_UNICODETOCP1258_CID);
  311. NS_DEFINE_NAMED_CID(NS_UNICODETOCP874_CID);
  312. NS_DEFINE_NAMED_CID(NS_UNICODETOCP866_CID);
  313. NS_DEFINE_NAMED_CID(NS_UNICODETOKOI8R_CID);
  314. NS_DEFINE_NAMED_CID(NS_UNICODETOKOI8U_CID);
  315. NS_DEFINE_NAMED_CID(NS_UNICODETOMACCYRILLIC_CID);
  316. NS_DEFINE_NAMED_CID(NS_UNICODETOUTF16BE_CID);
  317. NS_DEFINE_NAMED_CID(NS_UNICODETOUTF16LE_CID);
  318. NS_DEFINE_NAMED_CID(NS_UNICODETOUTF16_CID);
  319. NS_DEFINE_NAMED_CID(NS_UNICODETOUSERDEFINED_CID);
  320. NS_DEFINE_NAMED_CID(NS_SJISTOUNICODE_CID);
  321. NS_DEFINE_NAMED_CID(NS_EUCJPTOUNICODE_CID);
  322. NS_DEFINE_NAMED_CID( NS_ISO2022JPTOUNICODE_CID);
  323. NS_DEFINE_NAMED_CID(NS_UNICODETOSJIS_CID);
  324. NS_DEFINE_NAMED_CID(NS_UNICODETOEUCJP_CID);
  325. NS_DEFINE_NAMED_CID(NS_UNICODETOISO2022JP_CID);
  326. NS_DEFINE_NAMED_CID(NS_UNICODETOBIG5_CID);
  327. NS_DEFINE_NAMED_CID(NS_BIG5TOUNICODE_CID);
  328. NS_DEFINE_NAMED_CID(NS_EUCKRTOUNICODE_CID);
  329. NS_DEFINE_NAMED_CID(NS_UNICODETOEUCKR_CID);
  330. NS_DEFINE_NAMED_CID(NS_GBKTOUNICODE_CID);
  331. NS_DEFINE_NAMED_CID(NS_UNICODETOGBK_CID);
  332. NS_DEFINE_NAMED_CID(NS_GB18030TOUNICODE_CID);
  333. NS_DEFINE_NAMED_CID(NS_UNICODETOGB18030_CID);
  334. static const mozilla::Module::CIDEntry kUConvCIDs[] = {
  335. { &kNS_TEXTTOSUBURI_CID, false, nullptr, nsTextToSubURIConstructor },
  336. { &kNS_CONVERTERINPUTSTREAM_CID, false, nullptr, nsConverterInputStreamConstructor },
  337. { &kNS_CONVERTEROUTPUTSTREAM_CID, false, nullptr, nsConverterOutputStreamConstructor },
  338. { &kNS_ISCRIPTABLEUNICODECONVERTER_CID, false, nullptr, nsScriptableUnicodeConverterConstructor },
  339. { &kNS_UTF8CONVERTERSERVICE_CID, false, nullptr, nsUTF8ConverterServiceConstructor },
  340. { &kNS_ISO88591TOUNICODE_CID, false, nullptr, nsCP1252ToUnicodeConstructor },
  341. { &kNS_CP1252TOUNICODE_CID, false, nullptr, nsCP1252ToUnicodeConstructor },
  342. { &kNS_MACROMANTOUNICODE_CID, false, nullptr, nsMacRomanToUnicodeConstructor },
  343. { &kNS_REPLACEMENTTOUNICODE_CID, false, nullptr, nsReplacementToUnicodeConstructor },
  344. { &kNS_UTF8TOUNICODE_CID, false, nullptr, nsUTF8ToUnicodeConstructor },
  345. { &kNS_UNICODETOISO88591_CID, false, nullptr, nsUnicodeToISO88591Constructor },
  346. { &kNS_UNICODETOCP1252_CID, false, nullptr, nsUnicodeToCP1252Constructor },
  347. { &kNS_UNICODETOMACROMAN_CID, false, nullptr, nsUnicodeToMacRomanConstructor },
  348. { &kNS_UNICODETOUTF8_CID, false, nullptr, nsUnicodeToUTF8Constructor },
  349. { &kNS_ISO88592TOUNICODE_CID, false, nullptr, nsISO88592ToUnicodeConstructor },
  350. { &kNS_ISO88593TOUNICODE_CID, false, nullptr, nsISO88593ToUnicodeConstructor },
  351. { &kNS_ISO88594TOUNICODE_CID, false, nullptr, nsISO88594ToUnicodeConstructor },
  352. { &kNS_ISO88595TOUNICODE_CID, false, nullptr, nsISO88595ToUnicodeConstructor },
  353. { &kNS_ISO88596TOUNICODE_CID, false, nullptr, nsISO88596ToUnicodeConstructor },
  354. { &kNS_ISO88597TOUNICODE_CID, false, nullptr, nsISO88597ToUnicodeConstructor },
  355. { &kNS_ISO88598TOUNICODE_CID, false, nullptr, nsISO88598ToUnicodeConstructor },
  356. { &kNS_ISO88598ITOUNICODE_CID, false, nullptr, nsISO88598IToUnicodeConstructor },
  357. { &kNS_ISO885910TOUNICODE_CID, false, nullptr, nsISO885910ToUnicodeConstructor },
  358. { &kNS_ISO885913TOUNICODE_CID, false, nullptr, nsISO885913ToUnicodeConstructor },
  359. { &kNS_ISO885914TOUNICODE_CID, false, nullptr, nsISO885914ToUnicodeConstructor },
  360. { &kNS_ISO885915TOUNICODE_CID, false, nullptr, nsISO885915ToUnicodeConstructor },
  361. { &kNS_ISO885916TOUNICODE_CID, false, nullptr, nsISO885916ToUnicodeConstructor },
  362. { &kNS_CP1250TOUNICODE_CID, false, nullptr, nsCP1250ToUnicodeConstructor },
  363. { &kNS_CP1251TOUNICODE_CID, false, nullptr, nsCP1251ToUnicodeConstructor },
  364. { &kNS_CP1253TOUNICODE_CID, false, nullptr, nsCP1253ToUnicodeConstructor },
  365. { &kNS_CP1254TOUNICODE_CID, false, nullptr, nsCP1254ToUnicodeConstructor },
  366. { &kNS_CP1255TOUNICODE_CID, false, nullptr, nsCP1255ToUnicodeConstructor },
  367. { &kNS_CP1256TOUNICODE_CID, false, nullptr, nsCP1256ToUnicodeConstructor },
  368. { &kNS_CP1257TOUNICODE_CID, false, nullptr, nsCP1257ToUnicodeConstructor },
  369. { &kNS_CP1258TOUNICODE_CID, false, nullptr, nsCP1258ToUnicodeConstructor },
  370. { &kNS_CP874TOUNICODE_CID, false, nullptr, nsCP874ToUnicodeConstructor },
  371. { &kNS_CP866TOUNICODE_CID, false, nullptr, nsCP866ToUnicodeConstructor },
  372. { &kNS_KOI8RTOUNICODE_CID, false, nullptr, nsKOI8RToUnicodeConstructor },
  373. { &kNS_KOI8UTOUNICODE_CID, false, nullptr, nsKOI8UToUnicodeConstructor },
  374. { &kNS_MACCETOUNICODE_CID, false, nullptr, nsMacCEToUnicodeConstructor },
  375. { &kNS_MACGREEKTOUNICODE_CID, false, nullptr, nsMacGreekToUnicodeConstructor },
  376. { &kNS_MACTURKISHTOUNICODE_CID, false, nullptr, nsMacTurkishToUnicodeConstructor },
  377. { &kNS_MACCROATIANTOUNICODE_CID, false, nullptr, nsMacCroatianToUnicodeConstructor },
  378. { &kNS_MACROMANIANTOUNICODE_CID, false, nullptr, nsMacRomanianToUnicodeConstructor },
  379. { &kNS_MACCYRILLICTOUNICODE_CID, false, nullptr, nsMacCyrillicToUnicodeConstructor },
  380. { &kNS_MACICELANDICTOUNICODE_CID, false, nullptr, nsMacIcelandicToUnicodeConstructor },
  381. { &kNS_UTF16TOUNICODE_CID, false, nullptr, nsUTF16ToUnicodeConstructor },
  382. { &kNS_UTF16BETOUNICODE_CID, false, nullptr, nsUTF16BEToUnicodeConstructor },
  383. { &kNS_UTF16LETOUNICODE_CID, false, nullptr, nsUTF16LEToUnicodeConstructor },
  384. { &kNS_USERDEFINEDTOUNICODE_CID, false, nullptr, nsUserDefinedToUnicodeConstructor },
  385. { &kNS_MACARABICTOUNICODE_CID, false, nullptr, nsMacArabicToUnicodeConstructor },
  386. { &kNS_MACDEVANAGARITOUNICODE_CID, false, nullptr, nsMacDevanagariToUnicodeConstructor },
  387. { &kNS_MACFARSITOUNICODE_CID, false, nullptr, nsMacFarsiToUnicodeConstructor },
  388. { &kNS_MACGURMUKHITOUNICODE_CID, false, nullptr, nsMacGurmukhiToUnicodeConstructor },
  389. { &kNS_MACGUJARATITOUNICODE_CID, false, nullptr, nsMacGujaratiToUnicodeConstructor },
  390. { &kNS_MACHEBREWTOUNICODE_CID, false, nullptr, nsMacHebrewToUnicodeConstructor },
  391. { &kNS_UNICODETOISO88592_CID, false, nullptr, nsUnicodeToISO88592Constructor },
  392. { &kNS_UNICODETOISO88593_CID, false, nullptr, nsUnicodeToISO88593Constructor },
  393. { &kNS_UNICODETOISO88594_CID, false, nullptr, nsUnicodeToISO88594Constructor },
  394. { &kNS_UNICODETOISO88595_CID, false, nullptr, nsUnicodeToISO88595Constructor },
  395. { &kNS_UNICODETOISO88596_CID, false, nullptr, nsUnicodeToISO88596Constructor },
  396. { &kNS_UNICODETOISO88597_CID, false, nullptr, nsUnicodeToISO88597Constructor },
  397. { &kNS_UNICODETOISO88598_CID, false, nullptr, nsUnicodeToISO88598Constructor },
  398. { &kNS_UNICODETOISO88598I_CID, false, nullptr, nsUnicodeToISO88598IConstructor },
  399. { &kNS_UNICODETOISO885910_CID, false, nullptr, nsUnicodeToISO885910Constructor },
  400. { &kNS_UNICODETOISO885913_CID, false, nullptr, nsUnicodeToISO885913Constructor },
  401. { &kNS_UNICODETOISO885914_CID, false, nullptr, nsUnicodeToISO885914Constructor },
  402. { &kNS_UNICODETOISO885915_CID, false, nullptr, nsUnicodeToISO885915Constructor },
  403. { &kNS_UNICODETOISO885916_CID, false, nullptr, nsUnicodeToISO885916Constructor },
  404. { &kNS_UNICODETOCP1250_CID, false, nullptr, nsUnicodeToCP1250Constructor },
  405. { &kNS_UNICODETOCP1251_CID, false, nullptr, nsUnicodeToCP1251Constructor },
  406. { &kNS_UNICODETOCP1253_CID, false, nullptr, nsUnicodeToCP1253Constructor },
  407. { &kNS_UNICODETOCP1254_CID, false, nullptr, nsUnicodeToCP1254Constructor },
  408. { &kNS_UNICODETOCP1255_CID, false, nullptr, nsUnicodeToCP1255Constructor },
  409. { &kNS_UNICODETOCP1256_CID, false, nullptr, nsUnicodeToCP1256Constructor },
  410. { &kNS_UNICODETOCP1257_CID, false, nullptr, nsUnicodeToCP1257Constructor },
  411. { &kNS_UNICODETOCP1258_CID, false, nullptr, nsUnicodeToCP1258Constructor },
  412. { &kNS_UNICODETOCP874_CID, false, nullptr, nsUnicodeToCP874Constructor },
  413. { &kNS_UNICODETOCP866_CID, false, nullptr, nsUnicodeToCP866Constructor },
  414. { &kNS_UNICODETOKOI8R_CID, false, nullptr, nsUnicodeToKOI8RConstructor },
  415. { &kNS_UNICODETOKOI8U_CID, false, nullptr, nsUnicodeToKOI8UConstructor },
  416. { &kNS_UNICODETOMACCYRILLIC_CID, false, nullptr, nsUnicodeToMacCyrillicConstructor },
  417. { &kNS_UNICODETOUTF16BE_CID, false, nullptr, nsUnicodeToUTF16BEConstructor },
  418. { &kNS_UNICODETOUTF16LE_CID, false, nullptr, nsUnicodeToUTF16LEConstructor },
  419. { &kNS_UNICODETOUTF16_CID, false, nullptr, nsUnicodeToUTF16Constructor },
  420. { &kNS_UNICODETOUSERDEFINED_CID, false, nullptr, nsUnicodeToUserDefinedConstructor },
  421. { &kNS_SJISTOUNICODE_CID, false, nullptr, nsShiftJISToUnicodeConstructor },
  422. { &kNS_EUCJPTOUNICODE_CID, false, nullptr, nsEUCJPToUnicodeV2Constructor },
  423. { &kNS_ISO2022JPTOUNICODE_CID, false, nullptr, nsISO2022JPToUnicodeV2Constructor },
  424. { &kNS_UNICODETOSJIS_CID, false, nullptr, nsUnicodeToSJISConstructor },
  425. { &kNS_UNICODETOEUCJP_CID, false, nullptr, nsUnicodeToEUCJPConstructor },
  426. { &kNS_UNICODETOISO2022JP_CID, false, nullptr, nsUnicodeToISO2022JPConstructor },
  427. { &kNS_UNICODETOBIG5_CID, false, nullptr, nsUnicodeToBIG5Constructor },
  428. { &kNS_BIG5TOUNICODE_CID, false, nullptr, nsBIG5ToUnicodeConstructor },
  429. { &kNS_EUCKRTOUNICODE_CID, false, nullptr, nsCP949ToUnicodeConstructor },
  430. { &kNS_UNICODETOEUCKR_CID, false, nullptr, nsUnicodeToCP949Constructor },
  431. { &kNS_GBKTOUNICODE_CID, false, nullptr, nsGB18030ToUnicodeConstructor },
  432. { &kNS_UNICODETOGBK_CID, false, nullptr, nsUnicodeToGBKConstructor },
  433. { &kNS_GB18030TOUNICODE_CID, false, nullptr, nsGB18030ToUnicodeConstructor },
  434. { &kNS_UNICODETOGB18030_CID, false, nullptr, nsUnicodeToGB18030Constructor },
  435. { nullptr },
  436. };
  437. static const mozilla::Module::ContractIDEntry kUConvContracts[] = {
  438. { NS_ITEXTTOSUBURI_CONTRACTID, &kNS_TEXTTOSUBURI_CID },
  439. { NS_CONVERTERINPUTSTREAM_CONTRACTID, &kNS_CONVERTERINPUTSTREAM_CID },
  440. { "@mozilla.org/intl/converter-output-stream;1", &kNS_CONVERTEROUTPUTSTREAM_CID },
  441. { NS_ISCRIPTABLEUNICODECONVERTER_CONTRACTID, &kNS_ISCRIPTABLEUNICODECONVERTER_CID },
  442. { NS_UTF8CONVERTERSERVICE_CONTRACTID, &kNS_UTF8CONVERTERSERVICE_CID },
  443. { NS_ISO88591TOUNICODE_CONTRACTID, &kNS_ISO88591TOUNICODE_CID },
  444. { NS_CP1252TOUNICODE_CONTRACTID, &kNS_CP1252TOUNICODE_CID },
  445. { NS_MACROMANTOUNICODE_CONTRACTID, &kNS_MACROMANTOUNICODE_CID },
  446. { NS_REPLACEMENTTOUNICODE_CONTRACTID, &kNS_REPLACEMENTTOUNICODE_CID },
  447. { NS_UTF8TOUNICODE_CONTRACTID, &kNS_UTF8TOUNICODE_CID },
  448. { NS_UNICODETOISO88591_CONTRACTID, &kNS_UNICODETOISO88591_CID },
  449. { NS_UNICODETOCP1252_CONTRACTID, &kNS_UNICODETOCP1252_CID },
  450. { NS_UNICODETOMACROMAN_CONTRACTID, &kNS_UNICODETOMACROMAN_CID },
  451. { NS_UNICODETOUTF8_CONTRACTID, &kNS_UNICODETOUTF8_CID },
  452. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-2", &kNS_ISO88592TOUNICODE_CID },
  453. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-3", &kNS_ISO88593TOUNICODE_CID },
  454. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-4", &kNS_ISO88594TOUNICODE_CID },
  455. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-5", &kNS_ISO88595TOUNICODE_CID },
  456. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-6", &kNS_ISO88596TOUNICODE_CID },
  457. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-7", &kNS_ISO88597TOUNICODE_CID },
  458. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-8", &kNS_ISO88598TOUNICODE_CID },
  459. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-8-I", &kNS_ISO88598ITOUNICODE_CID },
  460. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-10", &kNS_ISO885910TOUNICODE_CID },
  461. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-13", &kNS_ISO885913TOUNICODE_CID },
  462. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-14", &kNS_ISO885914TOUNICODE_CID },
  463. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-15", &kNS_ISO885915TOUNICODE_CID },
  464. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-16", &kNS_ISO885916TOUNICODE_CID },
  465. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1250", &kNS_CP1250TOUNICODE_CID },
  466. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1251", &kNS_CP1251TOUNICODE_CID },
  467. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1253", &kNS_CP1253TOUNICODE_CID },
  468. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1254", &kNS_CP1254TOUNICODE_CID },
  469. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1255", &kNS_CP1255TOUNICODE_CID },
  470. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1256", &kNS_CP1256TOUNICODE_CID },
  471. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1257", &kNS_CP1257TOUNICODE_CID },
  472. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-1258", &kNS_CP1258TOUNICODE_CID },
  473. { NS_UNICODEDECODER_CONTRACTID_BASE "windows-874", &kNS_CP874TOUNICODE_CID },
  474. { NS_UNICODEDECODER_CONTRACTID_BASE "IBM866", &kNS_CP866TOUNICODE_CID },
  475. { NS_UNICODEDECODER_CONTRACTID_BASE "KOI8-R", &kNS_KOI8RTOUNICODE_CID },
  476. { NS_UNICODEDECODER_CONTRACTID_BASE "KOI8-U", &kNS_KOI8UTOUNICODE_CID },
  477. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-ce", &kNS_MACCETOUNICODE_CID },
  478. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-greek", &kNS_MACGREEKTOUNICODE_CID },
  479. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-turkish", &kNS_MACTURKISHTOUNICODE_CID },
  480. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-croatian", &kNS_MACCROATIANTOUNICODE_CID },
  481. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-romanian", &kNS_MACROMANIANTOUNICODE_CID },
  482. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-cyrillic", &kNS_MACCYRILLICTOUNICODE_CID },
  483. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-icelandic", &kNS_MACICELANDICTOUNICODE_CID },
  484. { NS_UNICODEDECODER_CONTRACTID_BASE "UTF-16", &kNS_UTF16TOUNICODE_CID },
  485. { NS_UNICODEDECODER_CONTRACTID_BASE "UTF-16BE", &kNS_UTF16BETOUNICODE_CID },
  486. { NS_UNICODEDECODER_CONTRACTID_BASE "UTF-16LE", &kNS_UTF16LETOUNICODE_CID },
  487. { NS_UNICODEDECODER_CONTRACTID_BASE "x-user-defined", &kNS_USERDEFINEDTOUNICODE_CID },
  488. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-arabic", &kNS_MACARABICTOUNICODE_CID },
  489. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-devanagari", &kNS_MACDEVANAGARITOUNICODE_CID },
  490. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-farsi", &kNS_MACFARSITOUNICODE_CID },
  491. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-gurmukhi", &kNS_MACGURMUKHITOUNICODE_CID },
  492. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-gujarati", &kNS_MACGUJARATITOUNICODE_CID },
  493. { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-hebrew", &kNS_MACHEBREWTOUNICODE_CID },
  494. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-2", &kNS_UNICODETOISO88592_CID },
  495. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-3", &kNS_UNICODETOISO88593_CID },
  496. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-4", &kNS_UNICODETOISO88594_CID },
  497. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-5", &kNS_UNICODETOISO88595_CID },
  498. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-6", &kNS_UNICODETOISO88596_CID },
  499. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-7", &kNS_UNICODETOISO88597_CID },
  500. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-8", &kNS_UNICODETOISO88598_CID },
  501. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-8-I", &kNS_UNICODETOISO88598I_CID },
  502. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-10", &kNS_UNICODETOISO885910_CID },
  503. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-13", &kNS_UNICODETOISO885913_CID },
  504. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-14", &kNS_UNICODETOISO885914_CID },
  505. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-15", &kNS_UNICODETOISO885915_CID },
  506. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-16", &kNS_UNICODETOISO885916_CID },
  507. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1250", &kNS_UNICODETOCP1250_CID },
  508. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1251", &kNS_UNICODETOCP1251_CID },
  509. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1253", &kNS_UNICODETOCP1253_CID },
  510. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1254", &kNS_UNICODETOCP1254_CID },
  511. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1255", &kNS_UNICODETOCP1255_CID },
  512. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1256", &kNS_UNICODETOCP1256_CID },
  513. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1257", &kNS_UNICODETOCP1257_CID },
  514. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-1258", &kNS_UNICODETOCP1258_CID },
  515. { NS_UNICODEENCODER_CONTRACTID_BASE "windows-874", &kNS_UNICODETOCP874_CID },
  516. { NS_UNICODEENCODER_CONTRACTID_BASE "IBM866", &kNS_UNICODETOCP866_CID },
  517. { NS_UNICODEENCODER_CONTRACTID_BASE "KOI8-R", &kNS_UNICODETOKOI8R_CID },
  518. { NS_UNICODEENCODER_CONTRACTID_BASE "KOI8-U", &kNS_UNICODETOKOI8U_CID },
  519. { NS_UNICODEENCODER_CONTRACTID_BASE "x-mac-cyrillic", &kNS_UNICODETOMACCYRILLIC_CID },
  520. { NS_UNICODEENCODER_CONTRACTID_BASE "UTF-16BE", &kNS_UNICODETOUTF16BE_CID },
  521. { NS_UNICODEENCODER_CONTRACTID_BASE "UTF-16LE", &kNS_UNICODETOUTF16LE_CID },
  522. { NS_UNICODEENCODER_CONTRACTID_BASE "UTF-16", &kNS_UNICODETOUTF16_CID },
  523. { NS_UNICODEENCODER_CONTRACTID_BASE "x-user-defined", &kNS_UNICODETOUSERDEFINED_CID },
  524. { NS_UNICODEDECODER_CONTRACTID_BASE "Shift_JIS", &kNS_SJISTOUNICODE_CID },
  525. { NS_UNICODEDECODER_CONTRACTID_BASE "EUC-JP", &kNS_EUCJPTOUNICODE_CID },
  526. { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-2022-JP", &kNS_ISO2022JPTOUNICODE_CID },
  527. { NS_UNICODEENCODER_CONTRACTID_BASE "Shift_JIS", &kNS_UNICODETOSJIS_CID },
  528. { NS_UNICODEENCODER_CONTRACTID_BASE "EUC-JP", &kNS_UNICODETOEUCJP_CID },
  529. { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-2022-JP", &kNS_UNICODETOISO2022JP_CID },
  530. { NS_UNICODEENCODER_CONTRACTID_BASE "Big5", &kNS_UNICODETOBIG5_CID },
  531. { NS_UNICODEDECODER_CONTRACTID_BASE "Big5", &kNS_BIG5TOUNICODE_CID },
  532. { NS_UNICODEDECODER_CONTRACTID_BASE "EUC-KR", &kNS_EUCKRTOUNICODE_CID },
  533. { NS_UNICODEENCODER_CONTRACTID_BASE "EUC-KR", &kNS_UNICODETOEUCKR_CID },
  534. { NS_UNICODEDECODER_CONTRACTID_BASE "gbk", &kNS_GBKTOUNICODE_CID },
  535. { NS_UNICODEENCODER_CONTRACTID_BASE "gbk", &kNS_UNICODETOGBK_CID },
  536. { NS_UNICODEDECODER_CONTRACTID_BASE "gb18030", &kNS_GB18030TOUNICODE_CID },
  537. { NS_UNICODEENCODER_CONTRACTID_BASE "gb18030", &kNS_UNICODETOGB18030_CID },
  538. { nullptr }
  539. };
  540. static const mozilla::Module kUConvModule = {
  541. mozilla::Module::kVersion,
  542. kUConvCIDs,
  543. kUConvContracts,
  544. kUConvCategories
  545. };
  546. NSMODULE_DEFN(nsUConvModule) = &kUConvModule;