2 // $Id: UTF16_Encoding_Converter.inl 80826 2008-03-04 14:51:23Z wotte $
4 // ======================================================================
6 // The actual conversion methods are covered by the copyright information
8 // Chad Elliott 4/28/2005
10 // Copyright 2001-2004 Unicode, Inc.
12 // Limitations on Rights to Redistribute This Code
14 // Unicode, Inc. hereby grants the right to freely use the information
15 // supplied in this file in the creation of products supporting the
16 // Unicode Standard, and to make copies of this file in any form
17 // for internal or external distribution as long as this notice
20 // ======================================================================
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 ACE_UTF16_Encoding_Converter::is_legal_utf8 (const ACE_Byte* source,
29 const ACE_Byte* srcptr = source + length;
36 // Everything else falls through when "true"...
37 case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
38 case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
39 case 2: if ((a = (*--srcptr)) > 0xBF) return false;
43 // no fall-through in this inner switch
66 if (*source >= 0x80 && *source < 0xC2)
76 ACE_END_VERSIONED_NAMESPACE_DECL