draw: check more quickly if we need UTF-8 conversion

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-12 15:16:01 +01:00
parent 88025f3d16
commit beabf82ddf
1 changed files with 4 additions and 3 deletions

7
draw.c
View File

@ -47,11 +47,12 @@ draw_iso2utf8(const char *iso, size_t len)
size_t utf8len;
char *utf8, *utf8p;
static iconv_t iso2utf8 = (iconv_t) -1;
static int8_t dont_need_convert = -1;
if(!len)
return NULL;
if(dont_need_convert == -1)
dont_need_convert = !a_strcmp(nl_langinfo(CODESET), "UTF-8");
if(!a_strcmp(nl_langinfo(CODESET), "UTF-8"))
if(!len || dont_need_convert)
return NULL;
if(iso2utf8 == (iconv_t) -1)