2 // ======================================================================
4 // The actual conversion methods are covered by the copyright information
6 // Chad Elliott 4/28/2005
8 // Copyright 2001-2004 Unicode, Inc.
10 // Limitations on Rights to Redistribute This Code
12 // Unicode, Inc. hereby grants the right to freely use the information
13 // supplied in this file in the creation of products supporting the
14 // Unicode Standard, and to make copies of this file in any form
15 // for internal or external distribution as long as this notice
18 // ======================================================================
20 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 ACE_UTF16_Encoding_Converter::is_legal_utf8 (const ACE_Byte* source,
27 const ACE_Byte* srcptr = source + length;
34 // Everything else falls through when "true"...
35 case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
36 case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
37 case 2: if ((a = (*--srcptr)) > 0xBF) return false;
41 // no fall-through in this inner switch
64 if (*source >= 0x80 && *source < 0xC2)
74 ACE_END_VERSIONED_NAMESPACE_DECL