summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-05 00:57:42 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-05 00:57:42 +0000
commit0c61e54f152eca6b7607fcce9ea512bc60a19060 (patch)
tree9f8278804e8d6212dff92b9a163b8999e01fbb54
parent42648a7aada48220fdfaf6acfe95b9614122f1da (diff)
downloadsamba-0c61e54f152eca6b7607fcce9ea512bc60a19060.tar.gz
samba-0c61e54f152eca6b7607fcce9ea512bc60a19060.tar.xz
samba-0c61e54f152eca6b7607fcce9ea512bc60a19060.zip
optimised the 7 bit case for utf8 conversion
-rw-r--r--source/lib/iconv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/iconv.c b/source/lib/iconv.c
index a5a7a847b5f..07d42eed8f6 100644
--- a/source/lib/iconv.c
+++ b/source/lib/iconv.c
@@ -368,7 +368,10 @@ static size_t utf8_pull(char **inbuf, size_t *inbytesleft,
unsigned char *uc = (unsigned char *)*outbuf;
int len = 1;
- if ((c[0] & 0xf0) == 0xe0) {
+ if ((c[0] & 0x80) == 0) {
+ uc[0] = c[0];
+ uc[1] = 0;
+ } else if ((c[0] & 0xf0) == 0xe0) {
if (*inbytesleft < 3) {
DEBUG(0,("short utf8 char\n"));
goto badseq;
@@ -384,9 +387,6 @@ static size_t utf8_pull(char **inbuf, size_t *inbytesleft,
uc[1] = (c[0]>>2) & 0x7;
uc[0] = (c[0]<<6) | (c[1]&0x3f);
len = 2;
- } else {
- uc[0] = c[0];
- uc[1] = 0;
}
(*inbuf) += len;