From 766942acf8f0c0d9ef6c16ffbdedefdfda0af4b2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 4 Apr 2004 06:02:31 -0500 Subject: http://web.archive.org/web/20040404060231/http:/www.unicode.org:80/Public/BETA/CVTUTF-1-2/ --- ConvertUTF.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ConvertUTF.c') 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; -- cgit v1.2.3