summaryrefslogtreecommitdiff
path: root/utfebcdic.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-08-26 16:23:24 -0600
committerKarl Williamson <khw@cpan.org>2016-08-31 20:32:36 -0600
commiteda91ad75c71796ed6c5d3da7850b2fd7566c2a2 (patch)
tree3b8337fe962ae39a02e4076e8a19e5cdf1e32f4f /utfebcdic.h
parentc24e28a36bb30e64307477dfa160309665221d61 (diff)
downloadperl-eda91ad75c71796ed6c5d3da7850b2fd7566c2a2.tar.gz
Add #defines for UTF-8 of highest representable code point
This will allow the next commit to not have to actually try to decode the UTF-8 string in order to see if it overflows the platform.
Diffstat (limited to 'utfebcdic.h')
-rw-r--r--utfebcdic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/utfebcdic.h b/utfebcdic.h
index a6ba4fa6a3..227e0eb3db 100644
--- a/utfebcdic.h
+++ b/utfebcdic.h
@@ -268,6 +268,14 @@ explicitly forbidden, and the shortest possible encoding should always be used
* for more */
#define QUESTION_MARK_CTRL LATIN1_TO_NATIVE(0x9F)
+/* Any I8 string larger than this will overflow the word if it were converted into a UV */
+#if defined(UV_IS_QUAD)
+# define HIGHEST_REPRESENTABLE_UTF8 "\xFF\xAF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF"
+#else
+# define HIGHEST_REPRESENTABLE_UTF8 "\xFF\xA0\xA0\xA0\xA0\xA0\xA0\xA3\xBF\xBF\xBF\xBF\xBF\xBF"
+#endif
+
+
/*
* ex: set ts=8 sts=4 sw=4 et:
*/