@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
@@ -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.
@@ -9,7 +9,7 @@ if(ANDROID)
9
9
  set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/${PACKAGE_HOST}/lib")
10
10
  elseif(APPLE)
11
11
  if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
12
- set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}")
12
+ set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/../..")
13
13
  else()
14
14
  set(PACKAGE_HOST "${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")
15
15
  set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/${PACKAGE_HOST}/lib")
@@ -1,4 +1,4 @@
1
- /* Copyright (C) 1999-2022 Free Software Foundation, Inc.
1
+ /* Copyright (C) 1999-2024 Free Software Foundation, Inc.
2
2
  This file is part of the GNU LIBICONV Library.
3
3
 
4
4
  The GNU LIBICONV Library is free software; you can redistribute it
@@ -20,25 +20,28 @@
20
20
  #ifndef _LIBICONV_H
21
21
  #define _LIBICONV_H
22
22
 
23
- #define _LIBICONV_VERSION 0x0111 /* version number: (major<<8) + minor */
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ #define _LIBICONV_VERSION 0x0112 /* version number: (major<<8) + minor */
24
28
  extern int _libiconv_version; /* Likewise */
25
29
 
30
+ #ifdef __cplusplus
31
+ }
32
+ #endif
33
+
26
34
  /* We would like to #include any system header file which could define
27
- iconv_t, 1. in order to eliminate the risk that the user gets compilation
35
+ iconv_t, in order to eliminate the risk that the user gets compilation
28
36
  errors because some other system header file includes /usr/include/iconv.h
29
- which defines iconv_t or declares iconv after this file, 2. when compiling
30
- for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
31
- binary compatible code.
37
+ which defines iconv_t or declares iconv after this file.
32
38
  But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
33
39
  has been installed in /usr/local/include, there is no way any more to
34
40
  include the original /usr/include/iconv.h. We simply have to get away
35
41
  without it.
36
- Ad 1. The risk that a system header file does
42
+ The risk that a system header file does
37
43
  #include "iconv.h" or #include_next "iconv.h"
38
- is small. They all do #include <iconv.h>.
39
- Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
40
- has to be a scalar type because (iconv_t)(-1) is a possible return value
41
- from iconv_open().) */
44
+ is small. They all do #include <iconv.h>. */
42
45
 
43
46
  /* Define iconv_t ourselves. */
44
47
  #undef iconv_t
@@ -66,9 +69,7 @@ extern "C" {
66
69
 
67
70
  /* Allocates descriptor for code conversion from encoding ‘fromcode’ to
68
71
  encoding ‘tocode’. */
69
- #ifndef LIBICONV_PLUG
70
72
  #define iconv_open libiconv_open
71
- #endif
72
73
  extern iconv_t iconv_open (const char* tocode, const char* fromcode);
73
74
 
74
75
  /* Converts, using conversion descriptor ‘cd’, at most ‘*inbytesleft’ bytes
@@ -76,15 +77,11 @@ extern iconv_t iconv_open (const char* tocode, const char* fromcode);
76
77
  ‘*outbuf’.
77
78
  Decrements ‘*inbytesleft’ and increments ‘*inbuf’ by the same amount.
78
79
  Decrements ‘*outbytesleft’ and increments ‘*outbuf’ by the same amount. */
79
- #ifndef LIBICONV_PLUG
80
80
  #define iconv libiconv
81
- #endif
82
81
  extern size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
83
82
 
84
83
  /* Frees resources allocated for conversion descriptor ‘cd’. */
85
- #ifndef LIBICONV_PLUG
86
84
  #define iconv_close libiconv_close
87
- #endif
88
85
  extern int iconv_close (iconv_t cd);
89
86
 
90
87
 
@@ -93,8 +90,6 @@ extern int iconv_close (iconv_t cd);
93
90
  #endif
94
91
 
95
92
 
96
- #ifndef LIBICONV_PLUG
97
-
98
93
  /* Nonstandard extensions. */
99
94
 
100
95
  #if 1
@@ -165,7 +160,6 @@ typedef void (*iconv_unicode_uc_to_mb_fallback)
165
160
  void* callback_arg),
166
161
  void* callback_arg,
167
162
  void* data);
168
- #if 1
169
163
  /* Fallback function. Invoked when a number of bytes could not be converted to
170
164
  a wide character. This function should process all bytes from inbuf and may
171
165
  produce replacement wide characters by calling the write_replacement
@@ -186,12 +180,6 @@ typedef void (*iconv_wchar_wc_to_mb_fallback)
186
180
  void* callback_arg),
187
181
  void* callback_arg,
188
182
  void* data);
189
- #else
190
- /* If the wchar_t type does not exist, these two fallback functions are never
191
- invoked. Their argument list therefore does not matter. */
192
- typedef void (*iconv_wchar_mb_to_wc_fallback) ();
193
- typedef void (*iconv_wchar_wc_to_mb_fallback) ();
194
- #endif
195
183
  /* Set of fallbacks. */
196
184
  struct iconv_fallbacks {
197
185
  iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback;
@@ -201,14 +189,30 @@ struct iconv_fallbacks {
201
189
  void* data;
202
190
  };
203
191
 
192
+ /* Surfaces.
193
+ The concept of surfaces is described in the 'recode' manual. */
194
+ #define ICONV_SURFACE_NONE 0
195
+ /* In EBCDIC encodings, 0x15 (which encodes the "newline function", see the
196
+ Unicode standard, chapter 5) maps to U+000A instead of U+0085. This is
197
+ for interoperability with C programs and Unix environments on z/OS. */
198
+ #define ICONV_SURFACE_EBCDIC_ZOS_UNIX 1
199
+
204
200
  /* Requests for iconvctl. */
205
- #define ICONV_TRIVIALP 0 /* int *argument */
206
- #define ICONV_GET_TRANSLITERATE 1 /* int *argument */
207
- #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */
208
- #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */
209
- #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */
210
- #define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */
211
- #define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */
201
+ #define ICONV_TRIVIALP 0 /* int *argument */
202
+ #define ICONV_GET_TRANSLITERATE 1 /* int *argument */
203
+ #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */
204
+ #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */
205
+ #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */
206
+ #define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */
207
+ #define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */
208
+ #define ICONV_GET_FROM_SURFACE 7 /* unsigned int *argument */
209
+ #define ICONV_SET_FROM_SURFACE 8 /* const unsigned int *argument */
210
+ #define ICONV_GET_TO_SURFACE 9 /* unsigned int *argument */
211
+ #define ICONV_SET_TO_SURFACE 10 /* const unsigned int *argument */
212
+ #define ICONV_GET_DISCARD_INVALID 11 /* int *argument */
213
+ #define ICONV_SET_DISCARD_INVALID 12 /* const int *argument */
214
+ #define ICONV_GET_DISCARD_NON_IDENTICAL 13 /* int *argument */
215
+ #define ICONV_SET_DISCARD_NON_IDENTICAL 14 /* const int *argument */
212
216
 
213
217
  /* Listing of locale independent encodings. */
214
218
  #define iconvlist libiconvlist
@@ -235,7 +239,5 @@ extern void libiconv_set_relocation_prefix (const char *orig_prefix,
235
239
  }
236
240
  #endif
237
241
 
238
- #endif
239
-
240
242
 
241
243
  #endif /* _LIBICONV_H */
@@ -1,5 +1,5 @@
1
1
  # libcharset.la - a libtool library file
2
- # Generated by libtool (GNU libtool) 2.4.7
2
+ # Generated by libtool (GNU libtool) 2.5.4
3
3
  #
4
4
  # Please DO NOT delete this file!
5
5
  # It is necessary for linking the library.
@@ -1,5 +1,5 @@
1
1
  # libiconv.la - a libtool library file
2
- # Generated by libtool (GNU libtool) 2.4.7
2
+ # Generated by libtool (GNU libtool) 2.5.4
3
3
  #
4
4
  # Please DO NOT delete this file!
5
5
  # It is necessary for linking the library.
@@ -23,9 +23,9 @@ dependency_libs=''
23
23
  weak_library_names=''
24
24
 
25
25
  # Version information for libiconv.
26
- current=8
27
- age=6
28
- revision=1
26
+ current=9
27
+ age=7
28
+ revision=0
29
29
 
30
30
  # Is this an already installed library?
31
31
  installed=yes
@@ -22,6 +22,7 @@
22
22
  <a href="#NAME">NAME</a><br>
23
23
  <a href="#SYNOPSIS">SYNOPSIS</a><br>
24
24
  <a href="#DESCRIPTION">DESCRIPTION</a><br>
25
+ <a href="#ENVIRONMENT">ENVIRONMENT</a><br>
25
26
  <a href="#EXAMPLES">EXAMPLES</a><br>
26
27
  <a href="#CONFORMING TO">CONFORMING TO</a><br>
27
28
  <a href="#SEE ALSO">SEE ALSO</a><br>
@@ -155,6 +156,17 @@ are printed in upper case, separated by whitespace, and
155
156
  alias names of an encoding are listed on the same line as
156
157
  the encoding itself.</p>
157
158
 
159
+ <h2>ENVIRONMENT
160
+ <a name="ENVIRONMENT"></a>
161
+ </h2>
162
+
163
+
164
+ <p style="margin-left:11%; margin-top: 1em">Conversion
165
+ from/to EBCDIC encodings can be modified in a specific way:
166
+ If the environment variable <b>ICONV_EBCDIC_ZOS_UNIX</b> is
167
+ set to a non-empty value, the EBCDIC newline 0x15 will get
168
+ mapped to LF instead of NEL.</p>
169
+
158
170
  <h2>EXAMPLES
159
171
  <a name="EXAMPLES"></a>
160
172
  </h2>
@@ -190,7 +202,7 @@ encodings.</p>
190
202
  </h2>
191
203
 
192
204
 
193
- <p style="margin-left:11%; margin-top: 1em">POSIX:2001</p>
205
+ <p style="margin-left:11%; margin-top: 1em">POSIX:2024</p>
194
206
 
195
207
  <h2>SEE ALSO
196
208
  <a name="SEE ALSO"></a>