Import Upstream version 0.69.0
[hcoop/debian/courier-authlib.git] / libs / rfc822 / rfc2047u.c
index c1bc48b..5a3bb85 100644 (file)
@@ -9,10 +9,10 @@
 #include       <string.h>
 #include       <stdlib.h>
 #include       <errno.h>
+#include       <courier-unicode.h>
 
 #include       "rfc822hdr.h"
 #include       "rfc2047.h"
-#include       "../unicode/unicode.h"
 
 #if LIBIDN
 #include <idna.h>
@@ -93,7 +93,7 @@ static void rfc822_display_addr_cb(const char *chset,
        memcpy(buf, content, cnt);
        buf[cnt]=0;
 
-       ptr=libmail_u_convert_tobuf(buf, chset, s->chset, NULL);
+       ptr=unicode_convert_tobuf(buf, chset, s->chset, NULL);
        free(buf);
 
        if (ptr)
@@ -131,7 +131,7 @@ int rfc822_display_name_int(const struct rfc822a *rfcp, int index,
 
        if (chset == NULL)
        {
-               s.chset="iso-8859-1";
+               s.chset="utf-8";
        }
        else
        {
@@ -356,7 +356,7 @@ int rfc822_display_addr_str(const char *tok,
                        (*print_func)(p, strlen(p), ptr);
                else
                {
-                       char *q=libmail_u_convert_tobuf(utf8_ptr,
+                       char *q=unicode_convert_tobuf(utf8_ptr,
                                                        "utf-8",
                                                        chset, NULL);
                        if (q)
@@ -474,7 +474,7 @@ int rfc2047_print_unicodeaddr(const struct rfc822a *a,
                        if (strchr(RFC822_SPECIALS, nbuf.bufptr[i]))
                                break;
 
-               cpbuf=libmail_u_convert_tobuf(nbuf.bufptr, "utf-8", charset,
+               cpbuf=unicode_convert_tobuf(nbuf.bufptr, "utf-8", charset,
                                              NULL);
 
                if (!cpbuf)
@@ -991,7 +991,7 @@ int rfc2047_decoder(const char *text,
                }
 
                if (i)
-                       (*callback)("iso-8859-1", "", text, i, ptr);
+                       (*callback)("utf-8", "", text, i, ptr);
 
                text += i;
 
@@ -1006,7 +1006,7 @@ int rfc2047_decoder(const char *text,
 
                if (rc == 0)
                {
-                       (*callback)("iso-8859-1", "", text, 2, ptr);
+                       (*callback)("utf-8", "", text, 2, ptr);
                        text += 2;
                        continue;
                }