@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
@@ -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.
@@ -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,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 */
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@cpp.js/package-iconv",
3
- "version": "1.0.0-beta.20",
4
- "nativeVersion": "1.17",
3
+ "version": "1.0.0-beta.21",
4
+ "nativeVersion": "1.18",
5
5
  "description": "This package provides the precompiled iconv library, built using cpp.js, for easy integration into JavaScript, WebAssembly and React Native projects. It provides a high-performance solution for converting between character encodings, ensuring cross-platform compatibility. Ideal for use in web and mobile applications.",
6
6
  "homepage": "https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-package-iconv#readme",
7
7
  "repository": "https://github.com/bugra9/cpp.js.git",
8
8
  "license": "LGPL",
9
9
  "type": "module",
10
10
  "devDependencies": {
11
- "cpp.js": "1.0.0-beta.26"
11
+ "cpp.js": "^1.0.0-beta.28"
12
12
  },
13
13
  "keywords": [
14
14
  "iconv",
@@ -22,7 +22,6 @@
22
22
  "build:wasm": "cppjs build -p WebAssembly",
23
23
  "build:android": "cppjs build -p Android",
24
24
  "build:ios": "cppjs build -p iOS",
25
- "clear": "rm -rf .cppjs dist *.xcframework",
26
- "postinstall": "cppjs postinstall"
25
+ "clear": "rm -rf .cppjs dist *.xcframework"
27
26
  }
28
27
  }
@@ -10,16 +10,19 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64_arm64e</string>
13
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libcharset.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
19
  <string>arm64e</string>
20
+ <string>x86_64</string>
20
21
  </array>
21
22
  <key>SupportedPlatform</key>
22
23
  <string>ios</string>
24
+ <key>SupportedPlatformVariant</key>
25
+ <string>simulator</string>
23
26
  </dict>
24
27
  <dict>
25
28
  <key>BinaryPath</key>
@@ -27,19 +30,16 @@
27
30
  <key>HeadersPath</key>
28
31
  <string>Headers</string>
29
32
  <key>LibraryIdentifier</key>
30
- <string>ios-arm64_arm64e_x86_64-simulator</string>
33
+ <string>ios-arm64_arm64e</string>
31
34
  <key>LibraryPath</key>
32
35
  <string>libcharset.a</string>
33
36
  <key>SupportedArchitectures</key>
34
37
  <array>
35
38
  <string>arm64</string>
36
39
  <string>arm64e</string>
37
- <string>x86_64</string>
38
40
  </array>
39
41
  <key>SupportedPlatform</key>
40
42
  <string>ios</string>
41
- <key>SupportedPlatformVariant</key>
42
- <string>simulator</string>
43
43
  </dict>
44
44
  </array>
45
45
  <key>CFBundlePackageType</key>