You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @brief Converts, using conversion descriptor 'cd', at most '*inbytesleft' bytes starting at '*inbuf', writing at most '*outbytesleft' bytes starting at '*outbuf'.
71
+
* @attention Decrements '*inbytesleft' and increments '*inbuf' by the same amount.
72
+
* @attention Decrements '*outbytesleft' and increments '*outbuf' by the same amount.
73
+
* @param cd Conversion descriptor.
74
+
* @param inbuf Input buffer.
75
+
* @param inbytesleft Input bytes left.
76
+
* @param outbuf Output buffer.
77
+
* @param outbytesleft Output bytes left.
78
+
* @return Number of converted characters (excluding terminators, -1 means error).
constexpr int ICONV_GET_FROM_SURFACE = 7; /* unsigned int *argument */
227
+
/**
228
+
* @brief Request for iconvctl.
229
+
*/
230
+
constexpr int ICONV_SET_FROM_SURFACE = 8; /* const unsigned int *argument */
231
+
/**
232
+
* @brief Request for iconvctl.
233
+
*/
234
+
constexpr int ICONV_GET_TO_SURFACE = 9; /* unsigned int *argument */
235
+
/**
236
+
* @brief Request for iconvctl.
237
+
*/
238
+
constexpr int ICONV_SET_TO_SURFACE = 10; /* const unsigned int *argument */
239
+
240
+
/**
241
+
* @brief Listing of locale independent encodings.
242
+
* @param do_one One encoding fallback function.
243
+
* @param data Data.
244
+
*/
159
245
extern @DLL_VARIABLE@ void iconvlist (int (*do_one) (unsigned int namescount,
160
246
const char * const * names,
161
247
void* data),
162
248
void* data);
163
249
164
-
/*
165
-
* This C function converts an entire string from one encoding to another,
166
-
* using iconv. Easier to use than iconv() itself, and supports autodetect
167
-
* encodings on input.
168
-
*
169
-
* int iconv_string (const char* tocode, const char* fromcode,
170
-
* const char* start, const char* end,
171
-
* char** resultp, size_t* lengthp)
172
-
*
173
-
* Converts a memory region given in encoding FROMCODE to a new memory
174
-
* region in encoding TOCODE. FROMCODE and TOCODE are as for iconv_open(3),
175
-
* except that FROMCODE may be one of the values when enabled extra features
176
-
* "autodetect_utf8" supports ISO-8859-1 and UTF-8
177
-
* "autodetect_jp" supports EUC-JP, ISO-2022-JP-2 and SHIFT_JIS
178
-
* "autodetect_kr" supports EUC-KR and ISO-2022-KR
179
-
* The input is in the memory region between start (inclusive) and end
180
-
* (exclusive). If resultp is not NULL, the output string is stored in
181
-
* *resultp; malloc/realloc is used to allocate the result.
182
-
*
183
-
* This function does not treat zero characters specially.
184
-
*
185
-
* Return value: 0 if successful, otherwise -1 and errno set. Particular
186
-
* errno values: EILSEQ and ENOMEM.
187
-
*
188
-
* Example:
189
-
* const char* s = ...;
190
-
* char* result = NULL;
191
-
* if (iconv_string("UCS-4-INTERNAL", "GBK",
192
-
* s, s+strlen(s)+1, &result, NULL) < 0)
193
-
* perror("iconv_string");
194
-
*
195
-
*/
250
+
/**
251
+
* @brief Converts an entire string from one encoding to another, using iconv. Easier to use than iconv() itself, and supports autodetect encodings on input when extra features enabled.
252
+
*
253
+
* @note Converts a memory region given in encoding FROMCODE to a new memory
254
+
* region in encoding TOCODE. FROMCODE and TOCODE are as for iconv_open(3),
255
+
* except that FROMCODE may be one of the values when enabled extra features.
256
+
*
257
+
* @note "autodetect_utf8"supports ISO-8859-1 and UTF-8
258
+
* @note "autodetect_jp" supports EUC-JP, ISO-2022-JP-2 and SHIFT_JIS
259
+
* @note "autodetect_kr" supports EUC-KR and ISO-2022-KR
260
+
* @note The input is in the memory region between start (inclusive) and end
261
+
* (exclusive). If resultp is not NULL, the output string is stored in
262
+
* *resultp; malloc/realloc is used to allocate the result.
263
+
*
264
+
* @note This function does not treat zero characters specially.
265
+
*
266
+
* @param tocode Target encoding.
267
+
* @param fromcode From encoding.
268
+
* @param start Source string start pointer.
269
+
* @param end Source string end pointer.
270
+
* @param resultp Result memory pointer.
271
+
* @param lengthp Pointer to a variable that stores the length of the result.
272
+
* @return Return 0 if successful, otherwise -1 and errno set. Particular errno values: EILSEQ and ENOMEM.
0 commit comments