@nocobase/plugin-multi-app-manager 1.2.13-alpha → 1.3.0-alpha.20240710084543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/package.json +2 -2
  2. package/dist/client/AppManager.d.ts +0 -10
  3. package/dist/client/AppNameInput.d.ts +0 -10
  4. package/dist/client/MultiAppManagerProvider.d.ts +0 -10
  5. package/dist/client/MultiAppManagerProvider.style.d.ts +0 -13
  6. package/dist/client/Settings.d.ts +0 -10
  7. package/dist/client/index.d.ts +0 -14
  8. package/dist/client/index.js +0 -10
  9. package/dist/client/settings/schemas/applications.d.ts +0 -18
  10. package/dist/client/utils.d.ts +0 -12
  11. package/dist/externalVersion.js +0 -25
  12. package/dist/index.d.ts +0 -10
  13. package/dist/index.js +0 -48
  14. package/dist/locale/en-US.json +0 -11
  15. package/dist/locale/es-ES.json +0 -9
  16. package/dist/locale/index.d.ts +0 -9
  17. package/dist/locale/index.js +0 -36
  18. package/dist/locale/ko_KR.json +0 -11
  19. package/dist/locale/pt-BR.json +0 -9
  20. package/dist/locale/zh-CN.json +0 -14
  21. package/dist/node_modules/mariadb/LICENSE +0 -502
  22. package/dist/node_modules/mariadb/callback.js +0 -41
  23. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +0 -278
  24. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  25. package/dist/node_modules/mariadb/lib/cmd/change-user.js +0 -149
  26. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +0 -17
  27. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +0 -102
  28. package/dist/node_modules/mariadb/lib/cmd/command.js +0 -168
  29. package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +0 -327
  30. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  31. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +0 -168
  32. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +0 -23
  33. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +0 -761
  34. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +0 -55
  35. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +0 -58
  36. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +0 -19
  37. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +0 -142
  38. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +0 -74
  39. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  40. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  41. package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +0 -74
  42. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +0 -29
  43. package/dist/node_modules/mariadb/lib/cmd/ping.js +0 -52
  44. package/dist/node_modules/mariadb/lib/cmd/query.js +0 -255
  45. package/dist/node_modules/mariadb/lib/cmd/quit.js +0 -28
  46. package/dist/node_modules/mariadb/lib/cmd/reset.js +0 -54
  47. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  48. package/dist/node_modules/mariadb/lib/cmd/stream.js +0 -45
  49. package/dist/node_modules/mariadb/lib/config/connection-options.js +0 -258
  50. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  51. package/dist/node_modules/mariadb/lib/config/pool-options.js +0 -47
  52. package/dist/node_modules/mariadb/lib/connection-callback.js +0 -160
  53. package/dist/node_modules/mariadb/lib/connection.js +0 -1460
  54. package/dist/node_modules/mariadb/lib/const/capabilities.js +0 -64
  55. package/dist/node_modules/mariadb/lib/const/collations.js +0 -473
  56. package/dist/node_modules/mariadb/lib/const/connection_status.js +0 -13
  57. package/dist/node_modules/mariadb/lib/const/error-code.js +0 -1282
  58. package/dist/node_modules/mariadb/lib/const/field-detail.js +0 -35
  59. package/dist/node_modules/mariadb/lib/const/field-type.js +0 -71
  60. package/dist/node_modules/mariadb/lib/const/server-status.js +0 -30
  61. package/dist/node_modules/mariadb/lib/const/state-change.js +0 -12
  62. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  63. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  64. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +0 -141
  65. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +0 -171
  66. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +0 -193
  67. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +0 -36
  68. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +0 -37
  69. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +0 -502
  70. package/dist/node_modules/mariadb/lib/io/packet.js +0 -515
  71. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  72. package/dist/node_modules/mariadb/lib/misc/connection-information.js +0 -96
  73. package/dist/node_modules/mariadb/lib/misc/errors.js +0 -123
  74. package/dist/node_modules/mariadb/lib/misc/parse.js +0 -1033
  75. package/dist/node_modules/mariadb/lib/misc/utils.js +0 -298
  76. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  77. package/dist/node_modules/mariadb/lib/pool-callback.js +0 -202
  78. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  79. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
  80. package/dist/node_modules/mariadb/lib/pool-promise.js +0 -108
  81. package/dist/node_modules/mariadb/node_modules/@types/node/assert/strict.d.ts +0 -8
  82. package/dist/node_modules/mariadb/node_modules/@types/node/assert.d.ts +0 -912
  83. package/dist/node_modules/mariadb/node_modules/@types/node/async_hooks.d.ts +0 -501
  84. package/dist/node_modules/mariadb/node_modules/@types/node/buffer.d.ts +0 -2232
  85. package/dist/node_modules/mariadb/node_modules/@types/node/child_process.d.ts +0 -1366
  86. package/dist/node_modules/mariadb/node_modules/@types/node/cluster.d.ts +0 -414
  87. package/dist/node_modules/mariadb/node_modules/@types/node/console.d.ts +0 -412
  88. package/dist/node_modules/mariadb/node_modules/@types/node/constants.d.ts +0 -18
  89. package/dist/node_modules/mariadb/node_modules/@types/node/crypto.d.ts +0 -3338
  90. package/dist/node_modules/mariadb/node_modules/@types/node/dgram.d.ts +0 -545
  91. package/dist/node_modules/mariadb/node_modules/@types/node/diagnostics_channel.d.ts +0 -152
  92. package/dist/node_modules/mariadb/node_modules/@types/node/dns/promises.d.ts +0 -370
  93. package/dist/node_modules/mariadb/node_modules/@types/node/dns.d.ts +0 -659
  94. package/dist/node_modules/mariadb/node_modules/@types/node/domain.d.ts +0 -169
  95. package/dist/node_modules/mariadb/node_modules/@types/node/events.d.ts +0 -651
  96. package/dist/node_modules/mariadb/node_modules/@types/node/fs/promises.d.ts +0 -1091
  97. package/dist/node_modules/mariadb/node_modules/@types/node/fs.d.ts +0 -3869
  98. package/dist/node_modules/mariadb/node_modules/@types/node/globals.d.ts +0 -294
  99. package/dist/node_modules/mariadb/node_modules/@types/node/globals.global.d.ts +0 -1
  100. package/dist/node_modules/mariadb/node_modules/@types/node/http.d.ts +0 -1396
  101. package/dist/node_modules/mariadb/node_modules/@types/node/http2.d.ts +0 -2101
  102. package/dist/node_modules/mariadb/node_modules/@types/node/https.d.ts +0 -391
  103. package/dist/node_modules/mariadb/node_modules/@types/node/index.d.ts +0 -129
  104. package/dist/node_modules/mariadb/node_modules/@types/node/inspector.d.ts +0 -2744
  105. package/dist/node_modules/mariadb/node_modules/@types/node/module.d.ts +0 -114
  106. package/dist/node_modules/mariadb/node_modules/@types/node/net.d.ts +0 -791
  107. package/dist/node_modules/mariadb/node_modules/@types/node/os.d.ts +0 -455
  108. package/dist/node_modules/mariadb/node_modules/@types/node/package.json +0 -220
  109. package/dist/node_modules/mariadb/node_modules/@types/node/path.d.ts +0 -180
  110. package/dist/node_modules/mariadb/node_modules/@types/node/perf_hooks.d.ts +0 -557
  111. package/dist/node_modules/mariadb/node_modules/@types/node/process.d.ts +0 -1481
  112. package/dist/node_modules/mariadb/node_modules/@types/node/punycode.d.ts +0 -117
  113. package/dist/node_modules/mariadb/node_modules/@types/node/querystring.d.ts +0 -131
  114. package/dist/node_modules/mariadb/node_modules/@types/node/readline.d.ts +0 -650
  115. package/dist/node_modules/mariadb/node_modules/@types/node/repl.d.ts +0 -424
  116. package/dist/node_modules/mariadb/node_modules/@types/node/stream/consumers.d.ts +0 -24
  117. package/dist/node_modules/mariadb/node_modules/@types/node/stream/promises.d.ts +0 -42
  118. package/dist/node_modules/mariadb/node_modules/@types/node/stream/web.d.ts +0 -330
  119. package/dist/node_modules/mariadb/node_modules/@types/node/stream.d.ts +0 -1249
  120. package/dist/node_modules/mariadb/node_modules/@types/node/string_decoder.d.ts +0 -67
  121. package/dist/node_modules/mariadb/node_modules/@types/node/timers/promises.d.ts +0 -68
  122. package/dist/node_modules/mariadb/node_modules/@types/node/timers.d.ts +0 -94
  123. package/dist/node_modules/mariadb/node_modules/@types/node/tls.d.ts +0 -1020
  124. package/dist/node_modules/mariadb/node_modules/@types/node/trace_events.d.ts +0 -161
  125. package/dist/node_modules/mariadb/node_modules/@types/node/tty.d.ts +0 -204
  126. package/dist/node_modules/mariadb/node_modules/@types/node/url.d.ts +0 -891
  127. package/dist/node_modules/mariadb/node_modules/@types/node/util.d.ts +0 -1594
  128. package/dist/node_modules/mariadb/node_modules/@types/node/v8.d.ts +0 -378
  129. package/dist/node_modules/mariadb/node_modules/@types/node/vm.d.ts +0 -507
  130. package/dist/node_modules/mariadb/node_modules/@types/node/wasi.d.ts +0 -158
  131. package/dist/node_modules/mariadb/node_modules/@types/node/worker_threads.d.ts +0 -649
  132. package/dist/node_modules/mariadb/node_modules/@types/node/zlib.d.ts +0 -517
  133. package/dist/node_modules/mariadb/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  134. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  135. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  136. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  137. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  138. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/modules.xml +0 -8
  139. package/dist/node_modules/mariadb/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  140. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
  141. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
  142. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/index.js +0 -23
  143. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/internal.js +0 -198
  144. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  145. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  146. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
  147. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  148. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  149. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  150. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  151. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  152. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  153. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  154. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  155. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf16.js +0 -197
  156. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf32.js +0 -319
  157. package/dist/node_modules/mariadb/node_modules/iconv-lite/encodings/utf7.js +0 -290
  158. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  159. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/index.d.ts +0 -41
  160. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/index.js +0 -180
  161. package/dist/node_modules/mariadb/node_modules/iconv-lite/lib/streams.js +0 -109
  162. package/dist/node_modules/mariadb/node_modules/iconv-lite/package.json +0 -44
  163. package/dist/node_modules/mariadb/package.json +0 -1
  164. package/dist/node_modules/mariadb/promise.js +0 -34
  165. package/dist/node_modules/mariadb/types/index.d.ts +0 -870
  166. package/dist/server/collections/applications.d.ts +0 -10
  167. package/dist/server/collections/applications.js +0 -75
  168. package/dist/server/index.d.ts +0 -11
  169. package/dist/server/index.js +0 -40
  170. package/dist/server/models/application.d.ts +0 -18
  171. package/dist/server/models/application.js +0 -50
  172. package/dist/server/server.d.ts +0 -26
  173. package/dist/server/server.js +0 -310
  174. package/dist/swagger/index.d.ts +0 -195
  175. package/dist/swagger/index.js +0 -226
@@ -1,188 +0,0 @@
1
- "use strict";
2
-
3
- // Description of supported double byte encodings and aliases.
4
- // Tables are not require()-d until they are needed to speed up library load.
5
- // require()-s are direct to support Browserify.
6
-
7
- module.exports = {
8
-
9
- // == Japanese/ShiftJIS ====================================================
10
- // All japanese encodings are based on JIS X set of standards:
11
- // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
12
- // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
13
- // Has several variations in 1978, 1983, 1990 and 1997.
14
- // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
15
- // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
16
- // 2 planes, first is superset of 0208, second - revised 0212.
17
- // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
18
-
19
- // Byte encodings are:
20
- // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
21
- // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
22
- // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
23
- // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
24
- // 0x00-0x7F - lower part of 0201
25
- // 0x8E, 0xA1-0xDF - upper part of 0201
26
- // (0xA1-0xFE)x2 - 0208 plane (94x94).
27
- // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
28
- // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
29
- // Used as-is in ISO2022 family.
30
- // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
31
- // 0201-1976 Roman, 0208-1978, 0208-1983.
32
- // * ISO2022-JP-1: Adds esc seq for 0212-1990.
33
- // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
34
- // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
35
- // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
36
- //
37
- // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
38
- //
39
- // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
40
-
41
- 'shiftjis': {
42
- type: '_dbcs',
43
- table: function() { return require('./tables/shiftjis.json') },
44
- encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
45
- encodeSkipVals: [{from: 0xED40, to: 0xF940}],
46
- },
47
- 'csshiftjis': 'shiftjis',
48
- 'mskanji': 'shiftjis',
49
- 'sjis': 'shiftjis',
50
- 'windows31j': 'shiftjis',
51
- 'ms31j': 'shiftjis',
52
- 'xsjis': 'shiftjis',
53
- 'windows932': 'shiftjis',
54
- 'ms932': 'shiftjis',
55
- '932': 'shiftjis',
56
- 'cp932': 'shiftjis',
57
-
58
- 'eucjp': {
59
- type: '_dbcs',
60
- table: function() { return require('./tables/eucjp.json') },
61
- encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
62
- },
63
-
64
- // TODO: KDDI extension to Shift_JIS
65
- // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
66
- // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
67
-
68
-
69
- // == Chinese/GBK ==========================================================
70
- // http://en.wikipedia.org/wiki/GBK
71
- // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
72
-
73
- // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
74
- 'gb2312': 'cp936',
75
- 'gb231280': 'cp936',
76
- 'gb23121980': 'cp936',
77
- 'csgb2312': 'cp936',
78
- 'csiso58gb231280': 'cp936',
79
- 'euccn': 'cp936',
80
-
81
- // Microsoft's CP936 is a subset and approximation of GBK.
82
- 'windows936': 'cp936',
83
- 'ms936': 'cp936',
84
- '936': 'cp936',
85
- 'cp936': {
86
- type: '_dbcs',
87
- table: function() { return require('./tables/cp936.json') },
88
- },
89
-
90
- // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
91
- 'gbk': {
92
- type: '_dbcs',
93
- table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
94
- },
95
- 'xgbk': 'gbk',
96
- 'isoir58': 'gbk',
97
-
98
- // GB18030 is an algorithmic extension of GBK.
99
- // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
100
- // http://icu-project.org/docs/papers/gb18030.html
101
- // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
102
- // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
103
- 'gb18030': {
104
- type: '_dbcs',
105
- table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
106
- gb18030: function() { return require('./tables/gb18030-ranges.json') },
107
- encodeSkipVals: [0x80],
108
- encodeAdd: {'€': 0xA2E3},
109
- },
110
-
111
- 'chinese': 'gb18030',
112
-
113
-
114
- // == Korean ===============================================================
115
- // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
116
- 'windows949': 'cp949',
117
- 'ms949': 'cp949',
118
- '949': 'cp949',
119
- 'cp949': {
120
- type: '_dbcs',
121
- table: function() { return require('./tables/cp949.json') },
122
- },
123
-
124
- 'cseuckr': 'cp949',
125
- 'csksc56011987': 'cp949',
126
- 'euckr': 'cp949',
127
- 'isoir149': 'cp949',
128
- 'korean': 'cp949',
129
- 'ksc56011987': 'cp949',
130
- 'ksc56011989': 'cp949',
131
- 'ksc5601': 'cp949',
132
-
133
-
134
- // == Big5/Taiwan/Hong Kong ================================================
135
- // There are lots of tables for Big5 and cp950. Please see the following links for history:
136
- // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
137
- // Variations, in roughly number of defined chars:
138
- // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
139
- // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
140
- // * Big5-2003 (Taiwan standard) almost superset of cp950.
141
- // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
142
- // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
143
- // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
144
- // Plus, it has 4 combining sequences.
145
- // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
146
- // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
147
- // Implementations are not consistent within browsers; sometimes labeled as just big5.
148
- // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
149
- // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
150
- // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
151
- // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
152
- // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
153
- //
154
- // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
155
- // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
156
-
157
- 'windows950': 'cp950',
158
- 'ms950': 'cp950',
159
- '950': 'cp950',
160
- 'cp950': {
161
- type: '_dbcs',
162
- table: function() { return require('./tables/cp950.json') },
163
- },
164
-
165
- // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
166
- 'big5': 'big5hkscs',
167
- 'big5hkscs': {
168
- type: '_dbcs',
169
- table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },
170
- encodeSkipVals: [
171
- // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
172
- // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU.
173
- // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter.
174
- 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe,
175
- 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca,
176
- 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62,
177
- 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef,
178
- 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed,
179
-
180
- // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345
181
- 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce,
182
- ],
183
- },
184
-
185
- 'cnbig5': 'big5hkscs',
186
- 'csbig5': 'big5hkscs',
187
- 'xxbig5': 'big5hkscs',
188
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- // Update this array if you add/rename/remove files in this directory.
4
- // We support Browserify by skipping automatic module discovery and requiring modules directly.
5
- var modules = [
6
- require("./internal"),
7
- require("./utf32"),
8
- require("./utf16"),
9
- require("./utf7"),
10
- require("./sbcs-codec"),
11
- require("./sbcs-data"),
12
- require("./sbcs-data-generated"),
13
- require("./dbcs-codec"),
14
- require("./dbcs-data"),
15
- ];
16
-
17
- // Put all encoding/alias/codec definitions to single object and export it.
18
- for (var i = 0; i < modules.length; i++) {
19
- var module = modules[i];
20
- for (var enc in module)
21
- if (Object.prototype.hasOwnProperty.call(module, enc))
22
- exports[enc] = module[enc];
23
- }
@@ -1,198 +0,0 @@
1
- "use strict";
2
- var Buffer = require("safer-buffer").Buffer;
3
-
4
- // Export Node.js internal encodings.
5
-
6
- module.exports = {
7
- // Encodings
8
- utf8: { type: "_internal", bomAware: true},
9
- cesu8: { type: "_internal", bomAware: true},
10
- unicode11utf8: "utf8",
11
-
12
- ucs2: { type: "_internal", bomAware: true},
13
- utf16le: "ucs2",
14
-
15
- binary: { type: "_internal" },
16
- base64: { type: "_internal" },
17
- hex: { type: "_internal" },
18
-
19
- // Codec.
20
- _internal: InternalCodec,
21
- };
22
-
23
- //------------------------------------------------------------------------------
24
-
25
- function InternalCodec(codecOptions, iconv) {
26
- this.enc = codecOptions.encodingName;
27
- this.bomAware = codecOptions.bomAware;
28
-
29
- if (this.enc === "base64")
30
- this.encoder = InternalEncoderBase64;
31
- else if (this.enc === "cesu8") {
32
- this.enc = "utf8"; // Use utf8 for decoding.
33
- this.encoder = InternalEncoderCesu8;
34
-
35
- // Add decoder for versions of Node not supporting CESU-8
36
- if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
37
- this.decoder = InternalDecoderCesu8;
38
- this.defaultCharUnicode = iconv.defaultCharUnicode;
39
- }
40
- }
41
- }
42
-
43
- InternalCodec.prototype.encoder = InternalEncoder;
44
- InternalCodec.prototype.decoder = InternalDecoder;
45
-
46
- //------------------------------------------------------------------------------
47
-
48
- // We use node.js internal decoder. Its signature is the same as ours.
49
- var StringDecoder = require('string_decoder').StringDecoder;
50
-
51
- if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
52
- StringDecoder.prototype.end = function() {};
53
-
54
-
55
- function InternalDecoder(options, codec) {
56
- this.decoder = new StringDecoder(codec.enc);
57
- }
58
-
59
- InternalDecoder.prototype.write = function(buf) {
60
- if (!Buffer.isBuffer(buf)) {
61
- buf = Buffer.from(buf);
62
- }
63
-
64
- return this.decoder.write(buf);
65
- }
66
-
67
- InternalDecoder.prototype.end = function() {
68
- return this.decoder.end();
69
- }
70
-
71
-
72
- //------------------------------------------------------------------------------
73
- // Encoder is mostly trivial
74
-
75
- function InternalEncoder(options, codec) {
76
- this.enc = codec.enc;
77
- }
78
-
79
- InternalEncoder.prototype.write = function(str) {
80
- return Buffer.from(str, this.enc);
81
- }
82
-
83
- InternalEncoder.prototype.end = function() {
84
- }
85
-
86
-
87
- //------------------------------------------------------------------------------
88
- // Except base64 encoder, which must keep its state.
89
-
90
- function InternalEncoderBase64(options, codec) {
91
- this.prevStr = '';
92
- }
93
-
94
- InternalEncoderBase64.prototype.write = function(str) {
95
- str = this.prevStr + str;
96
- var completeQuads = str.length - (str.length % 4);
97
- this.prevStr = str.slice(completeQuads);
98
- str = str.slice(0, completeQuads);
99
-
100
- return Buffer.from(str, "base64");
101
- }
102
-
103
- InternalEncoderBase64.prototype.end = function() {
104
- return Buffer.from(this.prevStr, "base64");
105
- }
106
-
107
-
108
- //------------------------------------------------------------------------------
109
- // CESU-8 encoder is also special.
110
-
111
- function InternalEncoderCesu8(options, codec) {
112
- }
113
-
114
- InternalEncoderCesu8.prototype.write = function(str) {
115
- var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
116
- for (var i = 0; i < str.length; i++) {
117
- var charCode = str.charCodeAt(i);
118
- // Naive implementation, but it works because CESU-8 is especially easy
119
- // to convert from UTF-16 (which all JS strings are encoded in).
120
- if (charCode < 0x80)
121
- buf[bufIdx++] = charCode;
122
- else if (charCode < 0x800) {
123
- buf[bufIdx++] = 0xC0 + (charCode >>> 6);
124
- buf[bufIdx++] = 0x80 + (charCode & 0x3f);
125
- }
126
- else { // charCode will always be < 0x10000 in javascript.
127
- buf[bufIdx++] = 0xE0 + (charCode >>> 12);
128
- buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
129
- buf[bufIdx++] = 0x80 + (charCode & 0x3f);
130
- }
131
- }
132
- return buf.slice(0, bufIdx);
133
- }
134
-
135
- InternalEncoderCesu8.prototype.end = function() {
136
- }
137
-
138
- //------------------------------------------------------------------------------
139
- // CESU-8 decoder is not implemented in Node v4.0+
140
-
141
- function InternalDecoderCesu8(options, codec) {
142
- this.acc = 0;
143
- this.contBytes = 0;
144
- this.accBytes = 0;
145
- this.defaultCharUnicode = codec.defaultCharUnicode;
146
- }
147
-
148
- InternalDecoderCesu8.prototype.write = function(buf) {
149
- var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
150
- res = '';
151
- for (var i = 0; i < buf.length; i++) {
152
- var curByte = buf[i];
153
- if ((curByte & 0xC0) !== 0x80) { // Leading byte
154
- if (contBytes > 0) { // Previous code is invalid
155
- res += this.defaultCharUnicode;
156
- contBytes = 0;
157
- }
158
-
159
- if (curByte < 0x80) { // Single-byte code
160
- res += String.fromCharCode(curByte);
161
- } else if (curByte < 0xE0) { // Two-byte code
162
- acc = curByte & 0x1F;
163
- contBytes = 1; accBytes = 1;
164
- } else if (curByte < 0xF0) { // Three-byte code
165
- acc = curByte & 0x0F;
166
- contBytes = 2; accBytes = 1;
167
- } else { // Four or more are not supported for CESU-8.
168
- res += this.defaultCharUnicode;
169
- }
170
- } else { // Continuation byte
171
- if (contBytes > 0) { // We're waiting for it.
172
- acc = (acc << 6) | (curByte & 0x3f);
173
- contBytes--; accBytes++;
174
- if (contBytes === 0) {
175
- // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
176
- if (accBytes === 2 && acc < 0x80 && acc > 0)
177
- res += this.defaultCharUnicode;
178
- else if (accBytes === 3 && acc < 0x800)
179
- res += this.defaultCharUnicode;
180
- else
181
- // Actually add character.
182
- res += String.fromCharCode(acc);
183
- }
184
- } else { // Unexpected continuation byte
185
- res += this.defaultCharUnicode;
186
- }
187
- }
188
- }
189
- this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
190
- return res;
191
- }
192
-
193
- InternalDecoderCesu8.prototype.end = function() {
194
- var res = 0;
195
- if (this.contBytes > 0)
196
- res += this.defaultCharUnicode;
197
- return res;
198
- }
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var Buffer = require("safer-buffer").Buffer;
3
-
4
- // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
5
- // correspond to encoded bytes (if 128 - then lower half is ASCII).
6
-
7
- exports._sbcs = SBCSCodec;
8
- function SBCSCodec(codecOptions, iconv) {
9
- if (!codecOptions)
10
- throw new Error("SBCS codec is called without the data.")
11
-
12
- // Prepare char buffer for decoding.
13
- if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
14
- throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
15
-
16
- if (codecOptions.chars.length === 128) {
17
- var asciiString = "";
18
- for (var i = 0; i < 128; i++)
19
- asciiString += String.fromCharCode(i);
20
- codecOptions.chars = asciiString + codecOptions.chars;
21
- }
22
-
23
- this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
24
-
25
- // Encoding buffer.
26
- var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
27
-
28
- for (var i = 0; i < codecOptions.chars.length; i++)
29
- encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
30
-
31
- this.encodeBuf = encodeBuf;
32
- }
33
-
34
- SBCSCodec.prototype.encoder = SBCSEncoder;
35
- SBCSCodec.prototype.decoder = SBCSDecoder;
36
-
37
-
38
- function SBCSEncoder(options, codec) {
39
- this.encodeBuf = codec.encodeBuf;
40
- }
41
-
42
- SBCSEncoder.prototype.write = function(str) {
43
- var buf = Buffer.alloc(str.length);
44
- for (var i = 0; i < str.length; i++)
45
- buf[i] = this.encodeBuf[str.charCodeAt(i)];
46
-
47
- return buf;
48
- }
49
-
50
- SBCSEncoder.prototype.end = function() {
51
- }
52
-
53
-
54
- function SBCSDecoder(options, codec) {
55
- this.decodeBuf = codec.decodeBuf;
56
- }
57
-
58
- SBCSDecoder.prototype.write = function(buf) {
59
- // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
60
- var decodeBuf = this.decodeBuf;
61
- var newBuf = Buffer.alloc(buf.length*2);
62
- var idx1 = 0, idx2 = 0;
63
- for (var i = 0; i < buf.length; i++) {
64
- idx1 = buf[i]*2; idx2 = i*2;
65
- newBuf[idx2] = decodeBuf[idx1];
66
- newBuf[idx2+1] = decodeBuf[idx1+1];
67
- }
68
- return newBuf.toString('ucs2');
69
- }
70
-
71
- SBCSDecoder.prototype.end = function() {
72
- }