summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-04-18 15:25:28 -0600
committerKarl Williamson <public@khwilliamson.com>2012-04-26 11:58:56 -0600
commit0447e8df3db3f566f76a613f62c5f4cdd7262997 (patch)
treefda9e9e14099a7ee147911071f95dd001bcaa3d1 /utf8.h
parent0ae1fa71a437dfa435b139674610ec992366d661 (diff)
downloadperl-0447e8df3db3f566f76a613f62c5f4cdd7262997.tar.gz
utf8.h: Use correct definition of start byte
The previous definition allowed for (illegal) overlongs. The uses of this macro in the core assume that it is accurate. The inacurracy can cause such code to fail.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/utf8.h b/utf8.h
index 152a937f54..06418d6800 100644
--- a/utf8.h
+++ b/utf8.h
@@ -139,9 +139,7 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
*/
#define UNI_IS_INVARIANT(c) (((UV)c) < 0x80)
-/* Note that C0 and C1 are invalid in legal UTF8, so the lower bound of the
- * below might ought to be C2 */
-#define UTF8_IS_START(c) (((U8)c) >= 0xc0)
+#define UTF8_IS_START(c) (((U8)c) >= 0xc2)
#define UTF8_IS_CONTINUATION(c) (((U8)c) >= 0x80 && (((U8)c) <= 0xbf))
#define UTF8_IS_CONTINUED(c) (((U8)c) & 0x80)