summaryrefslogtreecommitdiff
path: root/ConvertUTF.c
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2004-04-04 06:02:31 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2004-04-04 06:02:31 -0500
commit766942acf8f0c0d9ef6c16ffbdedefdfda0af4b2 (patch)
tree9922f53781c5e5a0be55d67d909b4714e25e4b87 /ConvertUTF.c
parent69598662f36c6738ff9774d0c57271b8bf069b2c (diff)
http://web.archive.org/web/20040404060231/http:/www.unicode.org:80/Public/BETA/CVTUTF-1-2/BETA/CVTUTF-1-2
Diffstat (limited to 'ConvertUTF.c')
-rw-r--r--ConvertUTF.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ConvertUTF.c b/ConvertUTF.c
index 0a18518..649fbc8 100644
--- a/ConvertUTF.c
+++ b/ConvertUTF.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2003 Unicode, Inc.
+ * Copyright 2001-2004 Unicode, Inc.
*
* Disclaimer
*
@@ -31,6 +31,7 @@
source sequences, enhanced error detection, added casts
to eliminate compiler warnings.
July 2003: slight mods to back out aggressive FFFE detection.
+ Jan 2004: updated switches in from-UTF8 conversions.
See the header file "ConvertUTF.h" for complete documentation.
@@ -345,6 +346,8 @@ ConversionResult ConvertUTF8toUTF16 (
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6;
+ case 4: ch += *source++; ch <<= 6;
case 3: ch += *source++; ch <<= 6;
case 2: ch += *source++; ch <<= 6;
case 1: ch += *source++; ch <<= 6;
@@ -465,6 +468,8 @@ ConversionResult ConvertUTF8toUTF32 (
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6;
+ case 4: ch += *source++; ch <<= 6;
case 3: ch += *source++; ch <<= 6;
case 2: ch += *source++; ch <<= 6;
case 1: ch += *source++; ch <<= 6;