diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-11 18:50:13 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-11 18:50:13 +0000 |
commit | c6d16eea4394ff1c4d12cb435eebb0686b5ee736 (patch) | |
tree | 05204f5e3d5ff44efc246891a84aa2f76ec70314 /source3/lib | |
parent | 0e402f197da78abca13d08d924027ac68d51a1d2 (diff) | |
download | samba-c6d16eea4394ff1c4d12cb435eebb0686b5ee736.tar.gz samba-c6d16eea4394ff1c4d12cb435eebb0686b5ee736.tar.bz2 samba-c6d16eea4394ff1c4d12cb435eebb0686b5ee736.zip |
the UNICODE issue...
(This used to be commit 73db80f34183324845407b00f58462ff2d7b47ea)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 5e73fe6ada..641f891f83 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -199,8 +199,34 @@ return number of unicode chars copied, excluding the null character. only handles ascii strings Unicode strings created are in little-endian format. ********************************************************************/ +int str_to_unistr16(uint16 *dst, const char *src) +{ + size_t len = 0; + + if (dst == NULL) + return 0; + + if (src != NULL) + { + for (; *src && len < MAXUNI-2; len++, dst++, src++) + { + *dst = *src; + } + } + + *dst = 0; + + return len; +} + +/******************************************************************* +create a null-terminated unicode string from a null-terminated ascii string. +return number of unicode chars copied, excluding the null character. +only handles ascii strings +Unicode strings created are in little-endian format. +********************************************************************/ -int struni2(char *dst, const char *src) +int str_to_unistr8(char *dst, const char *src) { size_t len = 0; |