summaryrefslogtreecommitdiff
path: root/ConvertUTF.c
diff options
context:
space:
mode:
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;