31 #if defined (HAVE_CONFIG_H)
45 size_t srclen,
size_t *lengthp)
47 return u8_conv_from_encoding (fromcode, iconveh_question_mark,
48 src, srclen, NULL, NULL, lengthp);
53 size_t srclen,
size_t *lengthp)
55 return u8_conv_to_encoding (tocode, iconveh_question_mark,
56 src, srclen, NULL, NULL, lengthp);
61 size_t srclen,
size_t *lengthp)
63 return u8_conv_to_encoding (tocode, iconveh_error,
64 src, srclen, NULL, NULL, lengthp);
69 size_t srclen,
size_t *lengthp)
71 return u32_conv_to_encoding (tocode, iconveh_error,
72 src, srclen, NULL, NULL, lengthp);
77 (
const char *fromcode,
const char *src,
size_t srclen,
78 size_t *offsets,
size_t *lengthp)
80 return u8_conv_from_encoding (fromcode, iconveh_question_mark,
81 src, srclen, offsets, NULL, lengthp);
86 (
const char *tocode,
const uint8_t *src,
size_t srclen,
87 size_t *offsets,
size_t *lengthp)
89 return u8_conv_to_encoding (tocode, iconveh_question_mark,
90 src, srclen, offsets, NULL, lengthp);
99 size_t srclen = wcslen (wc) *
sizeof (wchar_t);
100 const char *src = (
const char *) wc;
103 uint8_t *mbchar = u8_conv_from_encoding (
"wchar_t", iconveh_question_mark,
104 src, srclen, NULL, NULL, &length);
107 char *retval =
malloc (length + 1);
110 memcpy (retval, mbchar, length);
111 free ((
void *) mbchar);
115 free ((
void *) mbchar);
126 size_t srclen =
strlen (u8);
127 const uint8_t *src = (
const uint8_t *) u8;
131 char *wchar = u8_conv_to_encoding (
"wchar_t", iconveh_question_mark,
132 src, srclen, NULL, NULL, &length);
134 wchar_t *retval =
malloc (length + 1 *
sizeof (
wchar_t));
137 memcpy (retval, wchar, length);
138 free ((
void *) wchar);
139 retval[length /
sizeof (wchar_t)] = 0;
143 free ((
void *) wchar);
T::size_type strlen(const typename T::value_type *str)
uint8_t * octave_u8_conv_from_encoding_offsets(const char *fromcode, const char *src, size_t srclen, size_t *offsets, size_t *lengthp)
char * octave_u8_conv_to_encoding_offsets(const char *tocode, const uint8_t *src, size_t srclen, size_t *offsets, size_t *lengthp)
uint8_t * octave_u8_conv_from_encoding(const char *fromcode, const char *src, size_t srclen, size_t *lengthp)
char * octave_u32_conv_to_encoding_strict(const char *tocode, const uint32_t *src, size_t srclen, size_t *lengthp)
char * octave_u8_conv_to_encoding(const char *tocode, const uint8_t *src, size_t srclen, size_t *lengthp)
char * octave_u8_conv_to_encoding_strict(const char *tocode, const uint8_t *src, size_t srclen, size_t *lengthp)
wchar_t * u8_to_wchar(const char *u8)
char * u8_from_wchar(const wchar_t *wc)