-/* The following macros convert strings between given charsets (CONV_CHARSET_x).
- * The resulting string is allocated on the stack with the exception of cs_in == cs_out,
- * when the pointer to the input string is returned. */
+/* The following macros convert strings between given charsets (CONV_CHARSET_x). */
+
+#define stk_strconv(s, cs_in, cs_out) \
+ ({ struct conv_context _c; uns _l=stk_strconv_init(&_c, (s), (cs_in), (cs_out)); \
+ while (_l) _l=stk_strconv_step(&_c, alloca(_l), _l); _c.dest_start; })
+
+#define stk_strconv_to_utf8(s, cs_in) stk_strconv(s, cs_in, CONV_CHARSET_UTF8)
+#define stk_strconv_from_utf8(s, cs_out) stk_strconv(s, CONV_CHARSET_UTF8, cs_out)