summaryrefslogtreecommitdiff
path: root/source4/lib/charcnv.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-30 12:03:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:25 -0500
commit2de9ce9499803bac73ae9f49ce1fa7b57762c389 (patch)
tree73db3aa5ce4b57787c3146ea30794d7f9fbf6b65 /source4/lib/charcnv.c
parentf891ff694b84304ba34ec3b6367e52b30d77be59 (diff)
downloadsamba-2de9ce9499803bac73ae9f49ce1fa7b57762c389.tar.gz
samba-2de9ce9499803bac73ae9f49ce1fa7b57762c389.tar.bz2
samba-2de9ce9499803bac73ae9f49ce1fa7b57762c389.zip
r2106: try to cope with a wider range of UTF-16 characters when we are using
an external libiconv library. (This used to be commit 168be7fbd7ae876ded39f73a7835e91b35e67244)
Diffstat (limited to 'source4/lib/charcnv.c')
-rw-r--r--source4/lib/charcnv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/lib/charcnv.c b/source4/lib/charcnv.c
index b84814b41c..8204a3bcdd 100644
--- a/source4/lib/charcnv.c
+++ b/source4/lib/charcnv.c
@@ -47,7 +47,7 @@ static const char *charset_name(charset_t ch)
{
const char *ret = NULL;
- if (ch == CH_UCS2) ret = "UCS-2LE";
+ if (ch == CH_UCS2) ret = "UTF-16LE";
else if (ch == CH_UNIX) ret = lp_unix_charset();
else if (ch == CH_DOS) ret = lp_dos_charset();
else if (ch == CH_DISPLAY) ret = lp_display_charset();
@@ -82,10 +82,12 @@ void init_iconv(void)
/* so that charset_name() works we need to get the UNIX<->UCS2 going
first */
if (!conv_handles[CH_UNIX][CH_UCS2])
- conv_handles[CH_UNIX][CH_UCS2] = smb_iconv_open("UCS-2LE", "ASCII");
+ conv_handles[CH_UNIX][CH_UCS2] = smb_iconv_open(charset_name(CH_UCS2),
+ "ASCII");
if (!conv_handles[CH_UCS2][CH_UNIX])
- conv_handles[CH_UCS2][CH_UNIX] = smb_iconv_open("ASCII", "UCS-2LE");
+ conv_handles[CH_UCS2][CH_UNIX] = smb_iconv_open("ASCII",
+ charset_name(CH_UCS2));
for (c1=0;c1<NUM_CHARSETS;c1++) {
for (c2=0;c2<NUM_CHARSETS;c2++) {