comparison src/lib-charset/charset-utf8.c @ 18149:0e74934072e0

lib-charset: Added charset_utf8_to_utf8_begin() wrapper function. It's never supposed to fail, so it makes it nicer for the callers who need to use it.
author Timo Sirainen <tss@iki.fi>
date Thu, 15 Jan 2015 01:05:13 +0200
parents 7459c0891a85
children 3d9ec121dc81
comparison
equal deleted inserted replaced
18148:e645ee117fa9 18149:0e74934072e0
28 28
29 *result_r = charset_to_utf8(t, (const unsigned char *)input, 29 *result_r = charset_to_utf8(t, (const unsigned char *)input,
30 &len, output); 30 &len, output);
31 charset_to_utf8_end(&t); 31 charset_to_utf8_end(&t);
32 return 0; 32 return 0;
33 }
34
35 struct charset_translation *
36 charset_utf8_to_utf8_begin(normalizer_func_t *normalizer)
37 {
38 struct charset_translation *trans;
39
40 if (charset_to_utf8_begin("UTF-8", normalizer, &trans) < 0)
41 i_unreached();
42 return trans;
33 } 43 }
34 44
35 #ifndef HAVE_ICONV 45 #ifndef HAVE_ICONV
36 46
37 struct charset_translation { 47 struct charset_translation {