summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-01 04:39:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:27 -0500
commit31c1c7846f6b6e5848bc39a28a65118bfa98e35d (patch)
tree7387bbf9234320ca2c60011b34c76c08e2b274b0 /source4/librpc/ndr
parent48f3df41bb4c854b1049591e1c315c4c3b980984 (diff)
downloadsamba-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/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_basic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 34a1935c3b..7f36f7e4ba 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -421,14 +421,14 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
uint32_t len1, ofs, len2;
uint16_t len3;
int ret;
- int chset = CH_UCS2;
+ int chset = CH_UTF16;
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
}
if (NDR_BE(ndr)) {
- chset = CH_UCS2BE;
+ chset = CH_UTF16BE;
}
switch (ndr->flags & LIBNDR_STRING_FLAGS) {
@@ -600,14 +600,14 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
{
ssize_t s_len, c_len;
int ret;
- int chset = CH_UCS2;
+ int chset = CH_UTF16;
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
}
if (NDR_BE(ndr)) {
- chset = CH_UCS2BE;
+ chset = CH_UTF16BE;
}
s_len = s?strlen(s):0;