diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-01 04:39:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:27 -0500 |
commit | 31c1c7846f6b6e5848bc39a28a65118bfa98e35d (patch) | |
tree | 7387bbf9234320ca2c60011b34c76c08e2b274b0 /source4/torture/basic | |
parent | 48f3df41bb4c854b1049591e1c315c4c3b980984 (diff) | |
download | samba-31c1c7846f6b6e5848bc39a28a65118bfa98e35d.tar.gz samba-31c1c7846f6b6e5848bc39a28a65118bfa98e35d.tar.bz2 samba-31c1c7846f6b6e5848bc39a28a65118bfa98e35d.zip |
r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.
This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.
the lib/iconv.c changes need backporting to samba3
(This used to be commit 756f28ac95feaa84b42402723d5f7286865c78db)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/charset.c | 2 | ||||
-rw-r--r-- | source4/torture/basic/utable.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c index 330dcf1707..879f20617f 100644 --- a/source4/torture/basic/charset.c +++ b/source4/torture/basic/charset.c @@ -50,7 +50,7 @@ static NTSTATUS unicode_open(struct smbcli_tree *tree, } SSVAL(ucs_name, i*2, 0); - i = convert_string_allocate(CH_UCS2, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname); + i = convert_string_allocate(CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname); if (i == -1) { free(ucs_name); return NT_STATUS_NO_MEMORY; diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index f98e1b1b4a..6faf020ef9 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -50,7 +50,7 @@ BOOL torture_utable(int dummy) SSVAL(&c2, 0, c); fstrcpy(fname, "\\utable\\x"); p = fname+strlen(fname); - len = convert_string(CH_UCS2, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, &c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; @@ -107,7 +107,7 @@ static char *form_name(int c) p = fname+strlen(fname); SSVAL(&c2, 0, c); - len = convert_string(CH_UCS2, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, &c2, 2, p, sizeof(fname)-strlen(fname)); p[len] = 0; |