1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

switch from UCS2 to UCS-2LE

(This used to be commit e236a3e29e)
This commit is contained in:
Andrew Tridgell
2001-07-22 00:27:30 +00:00
parent 9cbe6e8166
commit 512351db92
2 changed files with 3 additions and 18 deletions

View File

@ -32,7 +32,6 @@ static smb_iconv_t
dos_to_unix=(smb_iconv_t)-1, /*unix format <-> dos codepage*/ dos_to_unix=(smb_iconv_t)-1, /*unix format <-> dos codepage*/
unix_to_dos=(smb_iconv_t)-1; /*for those clients who does not support unicode*/ unix_to_dos=(smb_iconv_t)-1; /*for those clients who does not support unicode*/
/**************************************************************************** /****************************************************************************
Initialize iconv conversion descriptors Initialize iconv conversion descriptors
****************************************************************************/ ****************************************************************************/
@ -47,8 +46,8 @@ void init_iconv(char *unix_charset, char *dos_charset)
if (!unix_charset || !*unix_charset) unix_charset = "ASCII"; if (!unix_charset || !*unix_charset) unix_charset = "ASCII";
if (!dos_charset || !*dos_charset) dos_charset = "ASCII"; if (!dos_charset || !*dos_charset) dos_charset = "ASCII";
ICONV(ucs2_to_unix, "UCS2", unix_charset) ICONV(ucs2_to_unix, "UCS-2LE", unix_charset)
ICONV(unix_to_ucs2, unix_charset, "UCS2") ICONV(unix_to_ucs2, unix_charset, "UCS-2LE")
ICONV(dos_to_unix, dos_charset, unix_charset) ICONV(dos_to_unix, dos_charset, unix_charset)
ICONV(unix_to_dos, unix_charset, dos_charset) ICONV(unix_to_dos, unix_charset, dos_charset)

View File

@ -40,7 +40,7 @@ static struct {
size_t (*push)(char **inbuf, size_t *inbytesleft, size_t (*push)(char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft); char **outbuf, size_t *outbytesleft);
} charsets[] = { } charsets[] = {
{"UCS2", iconv_copy, iconv_copy}, {"UCS-2LE", iconv_copy, iconv_copy},
{"UTF8", utf8_pull, utf8_push}, {"UTF8", utf8_pull, utf8_push},
{"ASCII", ascii_pull, ascii_push}, {"ASCII", ascii_pull, ascii_push},
{"WEIRD", weird_pull, weird_push}, {"WEIRD", weird_pull, weird_push},
@ -63,22 +63,8 @@ size_t smb_iconv(smb_iconv_t cd,
#ifdef HAVE_NATIVE_ICONV #ifdef HAVE_NATIVE_ICONV
if (cd->cd) { if (cd->cd) {
size_t ret; size_t ret;
#if 0
char *p = *outbuf;
char *q = *inbuf;
int inlen=*inbytesleft, outlen=*outbytesleft;
#endif
ret = iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); ret = iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft);
#if 0
if (strstr(p, "foo") || strstr(q, "foo")) {
DEBUG(0,("Foo 2!\n"));
dump_data(0, p, outlen - *outbytesleft);
dump_data(0, q, inlen - *inbytesleft);
}
#endif
/* if there was an error then reset the internal state, /* if there was an error then reset the internal state,
this ensures that we don't have a shift state remaining for this ensures that we don't have a shift state remaining for
character sets like SJIS */ character sets like SJIS */