summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-02-03 22:14:22 -0700
committerKarl Williamson <khw@cpan.org>2018-02-07 11:19:14 -0700
commit33f38593a187f963d7c347cd8125ddce79cccd5c (patch)
tree4a2859986171de3582240a4c540617fc66256baa /utf8.h
parent50f3d1063eaf7bc0b5db35dda5b1b3567b931a5b (diff)
downloadperl-33f38593a187f963d7c347cd8125ddce79cccd5c.tar.gz
Add uvchr_to_utf8_flags_msgs()
This is propmpted by Encode's needs. When called with the proper parameter, it returns any warnings instead of displaying them directly.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/utf8.h b/utf8.h
index cfcdf8413e..828d1d169a 100644
--- a/utf8.h
+++ b/utf8.h
@@ -66,9 +66,13 @@ the string is invariant.
#define is_ascii_string(s, len) is_utf8_invariant_string(s, len)
#define is_invariant_string(s, len) is_utf8_invariant_string(s, len)
+#define uvoffuni_to_utf8_flags(d,uv,flags) \
+ uvoffuni_to_utf8_flags_msgs(d, uv, flags, 0)
#define uvchr_to_utf8(a,b) uvchr_to_utf8_flags(a,b,0)
#define uvchr_to_utf8_flags(d,uv,flags) \
- uvoffuni_to_utf8_flags(d,NATIVE_TO_UNI(uv),flags)
+ uvchr_to_utf8_flags_msgs(d,uv,flags, 0)
+#define uvchr_to_utf8_flags_msgs(d,uv,flags,msgs) \
+ uvoffuni_to_utf8_flags_msgs(d,NATIVE_TO_UNI(uv),flags, msgs)
#define utf8_to_uvchr_buf(s, e, lenp) \
utf8n_to_uvchr(s, (U8*)(e) - (U8*)(s), lenp, \
ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY)
@@ -932,6 +936,12 @@ point's representation.
#define UNICODE_DISALLOW_SUPER 0x0040
#define UNICODE_DISALLOW_PERL_EXTENDED 0x0080
#define UNICODE_DISALLOW_ABOVE_31_BIT UNICODE_DISALLOW_PERL_EXTENDED
+
+#define UNICODE_GOT_SURROGATE UNICODE_DISALLOW_SURROGATE
+#define UNICODE_GOT_NONCHAR UNICODE_DISALLOW_NONCHAR
+#define UNICODE_GOT_SUPER UNICODE_DISALLOW_SUPER
+#define UNICODE_GOT_PERL_EXTENDED UNICODE_DISALLOW_PERL_EXTENDED
+
#define UNICODE_WARN_ILLEGAL_C9_INTERCHANGE \
(UNICODE_WARN_SURROGATE|UNICODE_WARN_SUPER)
#define UNICODE_WARN_ILLEGAL_INTERCHANGE \