svn commit: samba r2106 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Mon Aug 30 12:03:01 GMT 2004


Author: tridge
Date: 2004-08-30 12:03:01 +0000 (Mon, 30 Aug 2004)
New Revision: 2106

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib&rev=2106&nolog=1

Log:
try to cope with a wider range of UTF-16 characters when we are using
an external libiconv library. 



Modified:
   branches/SAMBA_4_0/source/lib/charcnv.c
   branches/SAMBA_4_0/source/lib/iconv.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_4_0/source/lib/charcnv.c	2004-08-30 07:36:16 UTC (rev 2105)
+++ branches/SAMBA_4_0/source/lib/charcnv.c	2004-08-30 12:03:01 UTC (rev 2106)
@@ -47,7 +47,7 @@
 {
 	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 @@
 	/* 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++) {

Modified: branches/SAMBA_4_0/source/lib/iconv.c
===================================================================
--- branches/SAMBA_4_0/source/lib/iconv.c	2004-08-30 07:36:16 UTC (rev 2105)
+++ branches/SAMBA_4_0/source/lib/iconv.c	2004-08-30 12:03:01 UTC (rev 2106)
@@ -55,9 +55,14 @@
 static size_t iconv_swab  (void *,const char **, size_t *, char **, size_t *);
 
 static const struct charset_functions const builtin_functions[] = {
+	/* windows is really neither UCS-2 not UTF-16 */
 	{"UCS-2LE",  iconv_copy, iconv_copy},
+	{"UTF-16LE",  iconv_copy, iconv_copy},
 	{"UCS-2BE",  iconv_swab, iconv_swab},
+
+	/* we include the UTF-8 alias to cope with differing locale settings */
 	{"UTF8",   utf8_pull,  utf8_push},
+	{"UTF-8",   utf8_pull,  utf8_push},
 	{"ASCII", ascii_pull, ascii_push},
 	{"UCS2-HEX", ucs2hex_pull, ucs2hex_push},
 	{NULL, NULL, NULL}



More information about the samba-cvs mailing list