@cpp.js/package-iconv 1.0.0-beta.20 → 1.0.0-beta.21

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 (94) hide show
  1. package/README.md +3 -0
  2. package/{dist/prebuilt/charset.xcframework/ios-arm64_arm64e_x86_64-simulator → charset.xcframework/ios-arm64_arm64e}/Headers/iconv.h +37 -35
  3. package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e/libcharset.a +0 -0
  4. package/{dist/prebuilt/charset.xcframework/ios-arm64_arm64e → charset.xcframework/ios-arm64_arm64e_x86_64-simulator}/Headers/iconv.h +37 -35
  5. package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e_x86_64-simulator/libcharset.a +0 -0
  6. package/dist/prebuilt/Android-arm64-v8a/include/iconv.h +37 -35
  7. package/dist/prebuilt/Android-arm64-v8a/lib/libcharset.la +2 -2
  8. package/dist/prebuilt/Android-arm64-v8a/lib/libiconv.la +5 -5
  9. package/dist/prebuilt/Android-arm64-v8a/lib/libiconv.so +0 -0
  10. package/dist/prebuilt/Android-arm64-v8a/share/doc/iconv.1.html +13 -1
  11. package/dist/prebuilt/Android-arm64-v8a/share/doc/iconv.3.html +55 -6
  12. package/dist/prebuilt/Android-arm64-v8a/share/doc/iconv_close.3.html +1 -1
  13. package/dist/prebuilt/Android-arm64-v8a/share/doc/iconv_open.3.html +14 -7
  14. package/dist/prebuilt/Android-arm64-v8a/share/doc/iconvctl.3.html +80 -6
  15. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/iconv.1 +6 -2
  16. package/dist/prebuilt/Android-arm64-v8a/share/man/man3/iconv.3 +44 -7
  17. package/dist/prebuilt/Android-arm64-v8a/share/man/man3/iconv_close.3 +2 -2
  18. package/dist/prebuilt/Android-arm64-v8a/share/man/man3/iconv_open.3 +13 -7
  19. package/dist/prebuilt/Android-arm64-v8a/share/man/man3/iconv_open_into.3 +1 -1
  20. package/dist/prebuilt/Android-arm64-v8a/share/man/man3/iconvctl.3 +51 -6
  21. package/dist/prebuilt/CMakeLists.txt +1 -1
  22. package/dist/prebuilt/Emscripten-x86_64/include/iconv.h +37 -35
  23. package/dist/prebuilt/Emscripten-x86_64/lib/libcharset.la +1 -1
  24. package/dist/prebuilt/Emscripten-x86_64/lib/libiconv.a +0 -0
  25. package/dist/prebuilt/Emscripten-x86_64/lib/libiconv.la +4 -4
  26. package/dist/prebuilt/Emscripten-x86_64/share/doc/iconv.1.html +13 -1
  27. package/dist/prebuilt/Emscripten-x86_64/share/doc/iconv.3.html +55 -6
  28. package/dist/prebuilt/Emscripten-x86_64/share/doc/iconv_close.3.html +1 -1
  29. package/dist/prebuilt/Emscripten-x86_64/share/doc/iconv_open.3.html +14 -7
  30. package/dist/prebuilt/Emscripten-x86_64/share/doc/iconvctl.3.html +80 -6
  31. package/dist/prebuilt/Emscripten-x86_64/share/locale/af/LC_MESSAGES/libiconv.mo +0 -0
  32. package/dist/prebuilt/Emscripten-x86_64/share/locale/be/LC_MESSAGES/libiconv.mo +0 -0
  33. package/dist/prebuilt/Emscripten-x86_64/share/locale/da/LC_MESSAGES/libiconv.mo +0 -0
  34. package/dist/prebuilt/Emscripten-x86_64/share/locale/eo/LC_MESSAGES/libiconv.mo +0 -0
  35. package/dist/prebuilt/Emscripten-x86_64/share/locale/et/LC_MESSAGES/libiconv.mo +0 -0
  36. package/dist/prebuilt/Emscripten-x86_64/share/locale/fr/LC_MESSAGES/libiconv.mo +0 -0
  37. package/dist/prebuilt/Emscripten-x86_64/share/locale/it/LC_MESSAGES/libiconv.mo +0 -0
  38. package/dist/prebuilt/Emscripten-x86_64/share/locale/ka/LC_MESSAGES/libiconv.mo +0 -0
  39. package/dist/prebuilt/Emscripten-x86_64/share/locale/lt/LC_MESSAGES/libiconv.mo +0 -0
  40. package/dist/prebuilt/Emscripten-x86_64/share/locale/pt_BR/LC_MESSAGES/libiconv.mo +0 -0
  41. package/dist/prebuilt/Emscripten-x86_64/share/locale/sv/LC_MESSAGES/libiconv.mo +0 -0
  42. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/iconv.1 +6 -2
  43. package/dist/prebuilt/Emscripten-x86_64/share/man/man3/iconv.3 +44 -7
  44. package/dist/prebuilt/Emscripten-x86_64/share/man/man3/iconv_close.3 +2 -2
  45. package/dist/prebuilt/Emscripten-x86_64/share/man/man3/iconv_open.3 +13 -7
  46. package/dist/prebuilt/Emscripten-x86_64/share/man/man3/iconv_open_into.3 +1 -1
  47. package/dist/prebuilt/Emscripten-x86_64/share/man/man3/iconvctl.3 +51 -6
  48. package/dist/prebuilt/iOS-iphoneos/include/iconv.h +37 -35
  49. package/dist/prebuilt/iOS-iphoneos/lib/libcharset.a +0 -0
  50. package/dist/prebuilt/iOS-iphoneos/lib/libcharset.la +1 -1
  51. package/dist/prebuilt/iOS-iphoneos/lib/libiconv.a +0 -0
  52. package/dist/prebuilt/iOS-iphoneos/lib/libiconv.la +4 -4
  53. package/dist/prebuilt/iOS-iphoneos/share/doc/iconv.1.html +13 -1
  54. package/dist/prebuilt/iOS-iphoneos/share/doc/iconv.3.html +55 -6
  55. package/dist/prebuilt/iOS-iphoneos/share/doc/iconv_close.3.html +1 -1
  56. package/dist/prebuilt/iOS-iphoneos/share/doc/iconv_open.3.html +14 -7
  57. package/dist/prebuilt/iOS-iphoneos/share/doc/iconvctl.3.html +80 -6
  58. package/dist/prebuilt/iOS-iphoneos/share/man/man1/iconv.1 +6 -2
  59. package/dist/prebuilt/iOS-iphoneos/share/man/man3/iconv.3 +44 -7
  60. package/dist/prebuilt/iOS-iphoneos/share/man/man3/iconv_close.3 +2 -2
  61. package/dist/prebuilt/iOS-iphoneos/share/man/man3/iconv_open.3 +13 -7
  62. package/dist/prebuilt/iOS-iphoneos/share/man/man3/iconv_open_into.3 +1 -1
  63. package/dist/prebuilt/iOS-iphoneos/share/man/man3/iconvctl.3 +51 -6
  64. package/dist/prebuilt/iOS-iphonesimulator/include/iconv.h +37 -35
  65. package/dist/prebuilt/iOS-iphonesimulator/lib/libcharset.a +0 -0
  66. package/dist/prebuilt/iOS-iphonesimulator/lib/libcharset.la +1 -1
  67. package/dist/prebuilt/iOS-iphonesimulator/lib/libiconv.a +0 -0
  68. package/dist/prebuilt/iOS-iphonesimulator/lib/libiconv.la +4 -4
  69. package/dist/prebuilt/iOS-iphonesimulator/share/doc/iconv.1.html +13 -1
  70. package/dist/prebuilt/iOS-iphonesimulator/share/doc/iconv.3.html +55 -6
  71. package/dist/prebuilt/iOS-iphonesimulator/share/doc/iconv_close.3.html +1 -1
  72. package/dist/prebuilt/iOS-iphonesimulator/share/doc/iconv_open.3.html +14 -7
  73. package/dist/prebuilt/iOS-iphonesimulator/share/doc/iconvctl.3.html +80 -6
  74. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/iconv.1 +6 -2
  75. package/dist/prebuilt/iOS-iphonesimulator/share/man/man3/iconv.3 +44 -7
  76. package/dist/prebuilt/iOS-iphonesimulator/share/man/man3/iconv_close.3 +2 -2
  77. package/dist/prebuilt/iOS-iphonesimulator/share/man/man3/iconv_open.3 +13 -7
  78. package/dist/prebuilt/iOS-iphonesimulator/share/man/man3/iconv_open_into.3 +1 -1
  79. package/dist/prebuilt/iOS-iphonesimulator/share/man/man3/iconvctl.3 +51 -6
  80. package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e/Headers/iconv.h +37 -35
  81. package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e/libiconv.a +0 -0
  82. package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e_x86_64-simulator/Headers/iconv.h +37 -35
  83. package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e_x86_64-simulator/libiconv.a +0 -0
  84. package/package.json +4 -5
  85. package/{dist/prebuilt/charset.xcframework → charset.xcframework}/Info.plist +5 -5
  86. /package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e/Headers/libcharset.h +0 -0
  87. /package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e/Headers/localcharset.h +0 -0
  88. /package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e_x86_64-simulator/Headers/libcharset.h +0 -0
  89. /package/{dist/prebuilt/charset.xcframework → charset.xcframework}/ios-arm64_arm64e_x86_64-simulator/Headers/localcharset.h +0 -0
  90. /package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/Info.plist +0 -0
  91. /package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e/Headers/libcharset.h +0 -0
  92. /package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e/Headers/localcharset.h +0 -0
  93. /package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e_x86_64-simulator/Headers/libcharset.h +0 -0
  94. /package/{dist/prebuilt/iconv.xcframework → iconv.xcframework}/ios-arm64_arm64e_x86_64-simulator/Headers/localcharset.h +0 -0
@@ -25,6 +25,7 @@
25
25
  <a href="#RETURN VALUE">RETURN VALUE</a><br>
26
26
  <a href="#ERRORS">ERRORS</a><br>
27
27
  <a href="#CONFORMING TO">CONFORMING TO</a><br>
28
+ <a href="#NOTES">NOTES</a><br>
28
29
  <a href="#SEE ALSO">SEE ALSO</a><br>
29
30
 
30
31
  <hr>
@@ -83,7 +84,7 @@ encoding of the input is stateful, the <b>iconv</b> function
83
84
  can also convert a sequence of input bytes to an update of
84
85
  the conversion state without producing any output bytes;
85
86
  such input is called a <i>shift sequence</i>. The conversion
86
- can stop for four reasons:</p>
87
+ can stop for five reasons:</p>
87
88
 
88
89
  <p style="margin-left:11%; margin-top: 1em">1. An invalid
89
90
  multibyte sequence is encountered in the input. In this case
@@ -91,20 +92,40 @@ it sets <b>errno</b> to <b>EILSEQ</b> and returns
91
92
  (size_t)(&minus;1). <i>*inbuf</i> is left pointing to the
92
93
  beginning of the invalid multibyte sequence.</p>
93
94
 
94
- <p style="margin-left:11%; margin-top: 1em">2. The input
95
+ <p style="margin-left:11%; margin-top: 1em">2. A multibyte
96
+ sequence is encountered that is valid but that cannot be
97
+ translated to the character encoding of the output. This
98
+ condition depends on the implementation and on the
99
+ conversion descriptor. In the GNU C library and GNU
100
+ libiconv, if <i>cd</i> was created without the suffix
101
+ <b>//TRANSLIT</b> or <b>//IGNORE</b> or
102
+ <b>//NON_IDENTICAL_DISCARD</b>, the conversion is strict:
103
+ lossy conversions produce this condition. If the suffix
104
+ <b>//TRANSLIT</b> was specified, transliteration can avoid
105
+ this condition in some cases. In the musl C library, this
106
+ condition cannot occur because a conversion to <b>'*'</b> is
107
+ used as a fallback. In the FreeBSD, NetBSD, and Solaris
108
+ implementations of <b>iconv</b>, this condition cannot occur
109
+ either, because a conversion to <b>'?'</b> is used as a
110
+ fallback. When this condition is met, the <b>iconv</b>
111
+ function sets <b>errno</b> to <b>EILSEQ</b> and returns
112
+ (size_t)(&minus;1). <i>*inbuf</i> is left pointing to the
113
+ beginning of the unconvertible multibyte sequence.</p>
114
+
115
+ <p style="margin-left:11%; margin-top: 1em">3. The input
95
116
  byte sequence has been entirely converted, i.e.
96
117
  <i>*inbytesleft</i> has gone down to 0. In this case
97
118
  <b>iconv</b> returns the number of non-reversible
98
119
  conversions performed during this call.</p>
99
120
 
100
- <p style="margin-left:11%; margin-top: 1em">3. An
121
+ <p style="margin-left:11%; margin-top: 1em">4. An
101
122
  incomplete multibyte sequence is encountered in the input,
102
123
  and the input byte sequence terminates after it. In this
103
124
  case it sets <b>errno</b> to <b>EINVAL</b> and returns
104
125
  (size_t)(&minus;1). <i>*inbuf</i> is left pointing to the
105
126
  beginning of the incomplete multibyte sequence.</p>
106
127
 
107
- <p style="margin-left:11%; margin-top: 1em">4. The output
128
+ <p style="margin-left:11%; margin-top: 1em">5. The output
108
129
  buffer has no more room for the next converted character. In
109
130
  this case it sets <b>errno</b> to <b>E2BIG</b> and returns
110
131
  (size_t)(&minus;1).</p>
@@ -191,7 +212,35 @@ the input.</p></td></tr>
191
212
  </h2>
192
213
 
193
214
 
194
- <p style="margin-left:11%; margin-top: 1em">POSIX:2001</p>
215
+ <p style="margin-left:11%; margin-top: 1em">POSIX:2024</p>
216
+
217
+ <h2>NOTES
218
+ <a name="NOTES"></a>
219
+ </h2>
220
+
221
+
222
+ <p style="margin-left:11%; margin-top: 1em">In each series
223
+ of calls to the <b>iconv</b> function, the last should be
224
+ one with <i>inbuf</i> or <i>*inbuf</i> equal to NULL, in
225
+ order to complete the conversion of any partially converted
226
+ input.</p>
227
+
228
+ <p style="margin-left:11%; margin-top: 1em">Although
229
+ <i>inbuf</i> and <i>outbuf</i> are typed as <b>const char
230
+ **</b> and <b>char **</b>, respectively, this does not mean
231
+ that the objects they point can be interpreted as C strings
232
+ or as arrays of characters: the interpretation of character
233
+ byte sequences is handled internally by the conversion
234
+ functions. In some encodings, a zero byte may be a valid
235
+ part of a multibyte character.</p>
236
+
237
+ <p style="margin-left:11%; margin-top: 1em">The caller of
238
+ the <b>iconv</b> function must ensure that the pointers
239
+ passed to the function are suitable for accessing characters
240
+ in the appropriate character set. For the encodings
241
+ <b>UCS-2-INTERNAL</b>, <b>UCS-4-INTERNAL</b>, and
242
+ <b>wchar_t</b>, this includes ensuring correct
243
+ alignment.</p>
195
244
 
196
245
  <h2>SEE ALSO
197
246
  <a name="SEE ALSO"></a>
@@ -200,7 +249,7 @@ the input.</p></td></tr>
200
249
 
201
250
 
202
251
  <p style="margin-left:11%; margin-top: 1em"><b>iconv_open</b>(3),
203
- <b>iconvctl</b>(3) <b>iconv_close</b>(3)</p>
252
+ <b>iconvctl</b>(3), <b>iconv_close</b>(3)</p>
204
253
  <hr>
205
254
  </body>
206
255
  </html>
@@ -74,7 +74,7 @@ case of error, it sets <b>errno</b> and returns
74
74
  </h2>
75
75
 
76
76
 
77
- <p style="margin-left:11%; margin-top: 1em">POSIX:2001</p>
77
+ <p style="margin-left:11%; margin-top: 1em">POSIX:2024</p>
78
78
 
79
79
  <h2>SEE ALSO
80
80
  <a name="SEE ALSO"></a>
@@ -90,9 +90,10 @@ ISO-2022&minus;JP&minus;MS</p>
90
90
  <p style="margin-left:11%;">Chinese</p>
91
91
 
92
92
  <p style="margin-left:22%;">EUC&minus;CN, HZ, GBK, CP936,
93
- GB18030, EUC&minus;TW, BIG5, CP950, BIG5&minus;HKSCS,
94
- BIG5&minus;HKSCS:2004, BIG5&minus;HKSCS:2001,
95
- BIG5&minus;HKSCS:1999, ISO&minus;2022&minus;CN,
93
+ GB18030, GB18030:2022, EUC&minus;TW, BIG5, CP950,
94
+ BIG5&minus;HKSCS, BIG5&minus;HKSCS:2004,
95
+ BIG5&minus;HKSCS:2001, BIG5&minus;HKSCS:1999,
96
+ ISO&minus;2022&minus;CN,
96
97
  ISO&minus;2022&minus;CN&minus;EXT</p>
97
98
 
98
99
  <table width="100%" border="0" rules="none" frame="void"
@@ -273,9 +274,15 @@ it can be approximated through one or several characters
273
274
  that look similar to the original character.</p>
274
275
 
275
276
  <p style="margin-left:11%; margin-top: 1em">When the string
276
- &quot;//IGNORE&quot; is appended to <i>tocode</i>,
277
- characters that cannot be represented in the target
278
- character set will be silently discarded.</p>
277
+ &quot;//IGNORE&quot; is appended to <i>tocode</i>, invalid
278
+ multibyte sequences in the input and characters that cannot
279
+ be represented in the target character set will be silently
280
+ discarded.</p>
281
+
282
+ <p style="margin-left:11%; margin-top: 1em">When the string
283
+ &quot;//NON_IDENTICAL_DISCARD&quot; is appended to
284
+ <i>tocode</i>, characters that cannot be represented in the
285
+ target character set will be silently discarded.</p>
279
286
 
280
287
  <p style="margin-left:11%; margin-top: 1em">The resulting
281
288
  conversion descriptor can be used with <b>iconv</b> any
@@ -330,7 +337,7 @@ not supported by the implementation.</p></td></tr>
330
337
  </h2>
331
338
 
332
339
 
333
- <p style="margin-left:11%; margin-top: 1em">POSIX:2001</p>
340
+ <p style="margin-left:11%; margin-top: 1em">POSIX:2024</p>
334
341
 
335
342
  <h2>SEE ALSO
336
343
  <a name="SEE ALSO"></a>
@@ -96,21 +96,95 @@ non-zero value is used to enable transliteration in the
96
96
  conversion. A zero value disables it.</p>
97
97
 
98
98
 
99
+ <p style="margin-left:11%;"><b>ICONV_GET_DISCARD_INVALID</b></p>
100
+
101
+ <p style="margin-left:22%;"><i>argument</i> should be an
102
+ <b>int *</b> which will receive 1 if &quot;discard invalid
103
+ multibyte sequence from the input and continue&quot; is
104
+ enabled in the conversion, or 0 otherwise.</p>
105
+
106
+
107
+ <p style="margin-left:11%;"><b>ICONV_SET_DISCARD_INVALID</b></p>
108
+
109
+ <p style="margin-left:22%;"><i>argument</i> should be a
110
+ <b>const int *</b>, pointing to an <b>int</b> value. A
111
+ non-zero value is used to enable &quot;discard invalid
112
+ multibyte sequence from the input and continue&quot; in the
113
+ conversion. A zero value disables it.</p>
114
+
115
+
116
+ <p style="margin-left:11%;"><b>ICONV_GET_DISCARD_NON_IDENTICAL</b></p>
117
+
118
+ <p style="margin-left:22%;"><i>argument</i> should be an
119
+ <b>int *</b> which will receive 1 if &quot;discard character
120
+ that cannot be represented in the target character set and
121
+ continue&quot; is enabled in the conversion, or 0
122
+ otherwise.</p>
123
+
124
+
125
+ <p style="margin-left:11%;"><b>ICONV_SET_DISCARD_NON_IDENTICAL</b></p>
126
+
127
+ <p style="margin-left:22%;"><i>argument</i> should be a
128
+ <b>const int *</b>, pointing to an <b>int</b> value. A
129
+ non-zero value is used to enable &quot;discard character
130
+ that cannot be represented in the target character set and
131
+ continue&quot; in the conversion. A zero value disables
132
+ it.</p>
133
+
134
+
99
135
  <p style="margin-left:11%;"><b>ICONV_GET_DISCARD_ILSEQ</b></p>
100
136
 
101
137
  <p style="margin-left:22%;"><i>argument</i> should be an
102
- <b>int *</b> which will receive 1 if &quot;illegal sequence
103
- discard and continue&quot; is enabled in the conversion, or
104
- 0 otherwise.</p>
138
+ <b>int *</b> which will receive 1 if both
139
+ &quot;discard&quot; behaviours are enabled in the
140
+ conversion, or 0 otherwise.</p>
105
141
 
106
142
 
107
143
  <p style="margin-left:11%;"><b>ICONV_SET_DISCARD_ILSEQ</b></p>
108
144
 
109
145
  <p style="margin-left:22%;"><i>argument</i> should be a
110
146
  <b>const int *</b>, pointing to an <b>int</b> value. A
111
- non-zero value is used to enable &quot;illegal sequence
112
- discard and continue&quot; in the conversion. A zero value
113
- disables it.</p>
147
+ non-zero value is used to enable both &quot;discard&quot;
148
+ behaviours in the conversion. A zero value disables
149
+ them.</p>
150
+
151
+
152
+ <p style="margin-left:11%;"><b>ICONV_GET_FROM_SURFACE</b></p>
153
+
154
+ <p style="margin-left:22%;"><i>argument</i> should be an
155
+ <b>unsigned int *</b> which will receive the from-side
156
+ (input side) surface of the conversion.</p>
157
+
158
+
159
+ <p style="margin-left:11%;"><b>ICONV_SET_FROM_SURFACE</b></p>
160
+
161
+ <p style="margin-left:22%;"><i>argument</i> should be a
162
+ <b>const unsigned int *</b>, pointing to an <b>unsigned
163
+ int</b> value. This value is installed as the from-side
164
+ (input side) surface of the conversion. The value is a bit
165
+ mask. Zero denotes no surface. The value
166
+ <b>ICONV_SURFACE_EBCDIC_ZOS_UNIX</b> has an effect on EBCDIC
167
+ encodings: The EBCDIC newline 0x15 will get mapped to LF
168
+ instead of NEL.</p>
169
+
170
+
171
+ <p style="margin-left:11%;"><b>ICONV_GET_TO_SURFACE</b></p>
172
+
173
+ <p style="margin-left:22%;"><i>argument</i> should be an
174
+ <b>unsigned int *</b> which will receive the to-side (output
175
+ side) surface of the conversion.</p>
176
+
177
+
178
+ <p style="margin-left:11%;"><b>ICONV_SET_TO_SURFACE</b></p>
179
+
180
+ <p style="margin-left:22%;"><i>argument</i> should be a
181
+ <b>const unsigned int *</b>, pointing to an <b>unsigned
182
+ int</b> value. This value is installed as the to-side
183
+ (output side) surface of the conversion. The value is a bit
184
+ mask. Zero denotes no surface. The value
185
+ <b>ICONV_SURFACE_EBCDIC_ZOS_UNIX</b> has an effect on EBCDIC
186
+ encodings: LF, instead of NEL, will get mapped to the EBCDIC
187
+ newline 0x15.</p>
114
188
 
115
189
  <h2>RETURN VALUE
116
190
  <a name="RETURN VALUE"></a>
@@ -9,7 +9,7 @@
9
9
  .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
10
10
  .\" POSIX 2001 draft6
11
11
  .\"
12
- .TH ICONV 1 "March 31, 2007" "GNU" "Linux Programmer's Manual"
12
+ .TH ICONV 1 "December 15, 2024" "GNU"
13
13
  .SH NAME
14
14
  iconv \- character set conversion
15
15
  .SH SYNOPSIS
@@ -84,6 +84,10 @@ supported encodings, in a system dependent format. For the libiconv
84
84
  implementation, the names are printed in upper case, separated by whitespace,
85
85
  and alias names of an encoding are listed on the same line as the encoding
86
86
  itself.
87
+ .SH ENVIRONMENT
88
+ Conversion from/to EBCDIC encodings can be modified in a specific way:
89
+ If the environment variable \fBICONV_EBCDIC_ZOS_UNIX\fP is set to a non-empty
90
+ value, the EBCDIC newline 0x15 will get mapped to LF instead of NEL.
87
91
  .SH EXAMPLES
88
92
  .TP
89
93
  \fBiconv \-f ISO\-8859\-1 \-t UTF\-8\fP
@@ -102,7 +106,7 @@ bytes and for valid but unconvertible characters.
102
106
  \fBiconv \-\-list\fP
103
107
  lists the supported encodings.
104
108
  .SH "CONFORMING TO"
105
- POSIX:2001
109
+ POSIX:2024
106
110
  .SH "SEE ALSO"
107
111
  .BR iconv_open (3),
108
112
  .BR locale (7)
@@ -9,7 +9,7 @@
9
9
  .\" GNU glibc-2 source code and manual
10
10
  .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
11
11
  .\"
12
- .TH ICONV 3 "September 7, 2008" "GNU" "Linux Programmer's Manual"
12
+ .TH ICONV 3 "December 15, 2024" "GNU"
13
13
  .SH NAME
14
14
  iconv \- perform character set conversion
15
15
  .SH SYNOPSIS
@@ -38,22 +38,41 @@ output bytes, and it updates the conversion state contained in \fIcd\fP.
38
38
  If the character encoding of the input is stateful, the \fBiconv\fP function
39
39
  can also convert a sequence of input bytes to an update of the conversion state
40
40
  without producing any output bytes; such input is called a \fIshift sequence\fP.
41
- The conversion can stop for four reasons:
41
+ The conversion can stop for five reasons:
42
42
  .PP
43
43
  1. An invalid multibyte sequence is encountered in the input. In this case
44
44
  it sets \fBerrno\fP to \fBEILSEQ\fP and returns (size_t)(\-1). \fI*inbuf\fP
45
45
  is left pointing to the beginning of the invalid multibyte sequence.
46
46
  .PP
47
- 2. The input byte sequence has been entirely converted, i.e. \fI*inbytesleft\fP
47
+ 2. A multibyte sequence is encountered that is valid but that cannot be
48
+ translated to the character encoding of the output.
49
+ This condition depends on the implementation and on the conversion
50
+ descriptor.
51
+ In the GNU C library and GNU libiconv, if \fIcd\fP was created without the
52
+ suffix \fB//TRANSLIT\fP or \fB//IGNORE\fP or \fB//NON_IDENTICAL_DISCARD\fP,
53
+ the conversion is strict: lossy conversions produce this condition.
54
+ If the suffix \fB//TRANSLIT\fP was specified, transliteration can avoid this
55
+ condition in some cases.
56
+ In the musl C library, this condition cannot occur because a conversion to
57
+ \fB\[aq]*\[aq]\fP is used as a fallback.
58
+ In the FreeBSD, NetBSD, and Solaris implementations of \fBiconv\fP, this
59
+ condition cannot occur either, because a conversion to \fB\[aq]?\[aq]\fP is
60
+ used as a fallback.
61
+ When this condition is met, the \fBiconv\fP function sets \fBerrno\fP to
62
+ \fBEILSEQ\fP and returns (size_t)(\-1).
63
+ \fI*inbuf\fP is left pointing to the beginning of the unconvertible multibyte
64
+ sequence.
65
+ .PP
66
+ 3. The input byte sequence has been entirely converted, i.e. \fI*inbytesleft\fP
48
67
  has gone down to 0. In this case \fBiconv\fP returns the number of
49
68
  non-reversible conversions performed during this call.
50
69
  .PP
51
- 3. An incomplete multibyte sequence is encountered in the input, and the
70
+ 4. An incomplete multibyte sequence is encountered in the input, and the
52
71
  input byte sequence terminates after it. In this case it sets \fBerrno\fP to
53
72
  \fBEINVAL\fP and returns (size_t)(\-1). \fI*inbuf\fP is left pointing to the
54
73
  beginning of the incomplete multibyte sequence.
55
74
  .PP
56
- 4. The output buffer has no more room for the next converted character. In
75
+ 5. The output buffer has no more room for the next converted character. In
57
76
  this case it sets \fBerrno\fP to \fBE2BIG\fP and returns (size_t)(\-1).
58
77
  .PP
59
78
  A different case is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, but
@@ -85,8 +104,26 @@ An invalid multibyte sequence has been encountered in the input.
85
104
  .B EINVAL
86
105
  An incomplete multibyte sequence has been encountered in the input.
87
106
  .SH "CONFORMING TO"
88
- POSIX:2001
107
+ POSIX:2024
108
+ .SH NOTES
109
+ In each series of calls to the \fBiconv\fP function,
110
+ the last should be one with \fIinbuf\fP or \fI*inbuf\fP equal to NULL,
111
+ in order to complete the conversion of any partially converted input.
112
+
113
+ Although \fIinbuf\fP and \fIoutbuf\fP are typed as
114
+ \fBconst char **\fP and \fBchar **\fP, respectively,
115
+ this does not mean that the objects they point can be interpreted
116
+ as C strings or as arrays of characters:
117
+ the interpretation of character byte sequences is
118
+ handled internally by the conversion functions.
119
+ In some encodings, a zero byte may be a valid part of a multibyte character.
120
+
121
+ The caller of the \fBiconv\fP function
122
+ must ensure that the pointers passed to the function are suitable
123
+ for accessing characters in the appropriate character set.
124
+ For the encodings \fBUCS-2-INTERNAL\fP, \fBUCS-4-INTERNAL\fP, and \fBwchar_t\fP,
125
+ this includes ensuring correct alignment.
89
126
  .SH "SEE ALSO"
90
127
  .BR iconv_open (3),
91
- .BR iconvctl (3)
128
+ .BR iconvctl (3),
92
129
  .BR iconv_close (3)
@@ -9,7 +9,7 @@
9
9
  .\" GNU glibc-2 source code and manual
10
10
  .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
11
11
  .\"
12
- .TH ICONV_CLOSE 3 "March 31, 2007" "GNU" "Linux Programmer's Manual"
12
+ .TH ICONV_CLOSE 3 "December 15, 2024" "GNU"
13
13
  .SH NAME
14
14
  iconv_close \- deallocate descriptor for character set conversion
15
15
  .SH SYNOPSIS
@@ -25,7 +25,7 @@ previously allocated using \fBiconv_open\fP.
25
25
  When successful, the \fBiconv_close\fP function returns 0. In case of error,
26
26
  it sets \fBerrno\fP and returns \-1.
27
27
  .SH "CONFORMING TO"
28
- POSIX:2001
28
+ POSIX:2024
29
29
  .SH "SEE ALSO"
30
30
  .BR iconv_open (3)
31
31
  .BR iconv (3)
@@ -9,7 +9,7 @@
9
9
  .\" GNU glibc-2 source code and manual
10
10
  .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
11
11
  .\"
12
- .TH ICONV_OPEN 3 "January 23, 2022" "GNU" "Linux Programmer's Manual"
12
+ .TH ICONV_OPEN 3 "December 15, 2024" "GNU"
13
13
  .SH NAME
14
14
  iconv_open \- allocate descriptor for character set conversion
15
15
  .SH SYNOPSIS
@@ -51,9 +51,9 @@ ISO-2022\-JP\-MS
51
51
  Chinese
52
52
  .nf
53
53
  .fi
54
- EUC\-CN, HZ, GBK, CP936, GB18030, EUC\-TW, BIG5, CP950, BIG5\-HKSCS,
55
- BIG5\-HKSCS:2004, BIG5\-HKSCS:2001, BIG5\-HKSCS:1999, ISO\-2022\-CN,
56
- ISO\-2022\-CN\-EXT
54
+ EUC\-CN, HZ, GBK, CP936, GB18030, GB18030:2022, EUC\-TW, BIG5, CP950,
55
+ BIG5\-HKSCS, BIG5\-HKSCS:2004, BIG5\-HKSCS:2001, BIG5\-HKSCS:1999,
56
+ ISO\-2022\-CN, ISO\-2022\-CN\-EXT
57
57
  .TP
58
58
  Korean
59
59
  .nf
@@ -225,8 +225,14 @@ is activated. This means that when a character cannot be represented in the
225
225
  target character set, it can be approximated through one or several characters
226
226
  that look similar to the original character.
227
227
  .PP
228
- When the string "//IGNORE" is appended to \fItocode\fP, characters that
229
- cannot be represented in the target character set will be silently discarded.
228
+ When the string "//IGNORE" is appended to \fItocode\fP,
229
+ invalid multibyte sequences in the input and
230
+ characters that cannot be represented in the target character set
231
+ will be silently discarded.
232
+ .PP
233
+ When the string "//NON_IDENTICAL_DISCARD" is appended to \fItocode\fP,
234
+ characters that cannot be represented in the target character set
235
+ will be silently discarded.
230
236
  .PP
231
237
  The resulting conversion descriptor can be used with \fBiconv\fP any number
232
238
  of times. It remains valid until deallocated using \fBiconv_close\fP.
@@ -247,7 +253,7 @@ The following error can occur, among others:
247
253
  The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the
248
254
  implementation.
249
255
  .SH "CONFORMING TO"
250
- POSIX:2001
256
+ POSIX:2024
251
257
  .SH "SEE ALSO"
252
258
  .BR iconv (3)
253
259
  .BR iconvctl (3)
@@ -8,7 +8,7 @@
8
8
  .\" References consulted:
9
9
  .\" iconv.h
10
10
  .\"
11
- .TH ICONV_OPEN_INTO 3 "September 21, 2008" "GNU" "Linux Programmer's Manual"
11
+ .TH ICONV_OPEN_INTO 3 "September 21, 2008" "GNU"
12
12
  .SH NAME
13
13
  iconv_open_into \- initialize descriptor for character set conversion
14
14
  .SH SYNOPSIS
@@ -9,7 +9,7 @@
9
9
  .\" References consulted:
10
10
  .\" iconv.h
11
11
  .\"
12
- .TH ICONVCTL 3 "March 31, 2007" "GNU" "Linux Programmer's Manual"
12
+ .TH ICONVCTL 3 "December 15, 2024" "GNU"
13
13
  .SH NAME
14
14
  iconvctl \- control iconv behavior
15
15
  .SH SYNOPSIS
@@ -41,15 +41,60 @@ transliteration is enabled in the conversion, or 0 otherwise.
41
41
  A non-zero value is used to enable transliteration in the conversion. A zero
42
42
  value disables it.
43
43
  .TP
44
+ .B ICONV_GET_DISCARD_INVALID
45
+ \fIargument\fP should be an \fBint *\fP which will receive 1 if "discard
46
+ invalid multibyte sequence from the input and continue"
47
+ is enabled in the conversion, or 0 otherwise.
48
+ .TP
49
+ .B ICONV_SET_DISCARD_INVALID
50
+ \fIargument\fP should be a \fBconst int *\fP, pointing to an \fBint\fP value.
51
+ A non-zero value is used to enable "discard
52
+ invalid multibyte sequence from the input and continue"
53
+ in the conversion. A zero value disables it.
54
+ .TP
55
+ .B ICONV_GET_DISCARD_NON_IDENTICAL
56
+ \fIargument\fP should be an \fBint *\fP which will receive 1 if "discard
57
+ character that cannot be represented in the target character set and continue"
58
+ is enabled in the conversion, or 0 otherwise.
59
+ .TP
60
+ .B ICONV_SET_DISCARD_NON_IDENTICAL
61
+ \fIargument\fP should be a \fBconst int *\fP, pointing to an \fBint\fP value.
62
+ A non-zero value is used to enable "discard
63
+ character that cannot be represented in the target character set and continue"
64
+ in the conversion. A zero value disables it.
65
+ .TP
44
66
  .B ICONV_GET_DISCARD_ILSEQ
45
- \fIargument\fP should be an \fBint *\fP which will receive 1 if
46
- "illegal sequence discard and continue" is enabled in the conversion,
47
- or 0 otherwise.
67
+ \fIargument\fP should be an \fBint *\fP which will receive 1 if both "discard"
68
+ behaviours are enabled in the conversion, or 0 otherwise.
48
69
  .TP
49
70
  .B ICONV_SET_DISCARD_ILSEQ
50
71
  \fIargument\fP should be a \fBconst int *\fP, pointing to an \fBint\fP value.
51
- A non-zero value is used to enable "illegal sequence discard and continue"
52
- in the conversion. A zero value disables it.
72
+ A non-zero value is used to enable both "discard" behaviours in the conversion.
73
+ A zero value disables them.
74
+ .TP
75
+ .B ICONV_GET_FROM_SURFACE
76
+ \fIargument\fP should be an \fBunsigned int *\fP which will receive the
77
+ from-side (input side) surface of the conversion.
78
+ .TP
79
+ .B ICONV_SET_FROM_SURFACE
80
+ \fIargument\fP should be a \fBconst unsigned int *\fP, pointing to an
81
+ \fBunsigned int\fP value. This value is installed as the from-side
82
+ (input side) surface of the conversion. The value is a bit mask. Zero
83
+ denotes no surface. The value \fBICONV_SURFACE_EBCDIC_ZOS_UNIX\fP has
84
+ an effect on EBCDIC encodings: The EBCDIC newline 0x15 will get mapped
85
+ to LF instead of NEL.
86
+ .TP
87
+ .B ICONV_GET_TO_SURFACE
88
+ \fIargument\fP should be an \fBunsigned int *\fP which will receive the
89
+ to-side (output side) surface of the conversion.
90
+ .TP
91
+ .B ICONV_SET_TO_SURFACE
92
+ \fIargument\fP should be a \fBconst unsigned int *\fP, pointing to an
93
+ \fBunsigned int\fP value. This value is installed as the to-side
94
+ (output side) surface of the conversion. The value is a bit mask. Zero
95
+ denotes no surface. The value \fBICONV_SURFACE_EBCDIC_ZOS_UNIX\fP has
96
+ an effect on EBCDIC encodings: LF, instead of NEL, will get mapped to
97
+ the EBCDIC newline 0x15.
53
98
  .SH "RETURN VALUE"
54
99
  The \fBiconvctl\fP function returns 0 if it succeeds. In case of error, it sets
55
100
  \fBerrno\fP and returns \-1.