diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-01-09 12:37:03 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-01-09 19:29:02 -0700 |
commit | 0876b9a01ce95023535c197900c755d5c98d616f (patch) | |
tree | 7da60e7cc7ebd37721babdc7b4466a35a2f7e596 /doio.c | |
parent | bcd05b946b5a96ca0b2734a1042bda6af592c97b (diff) | |
download | perl-0876b9a01ce95023535c197900c755d5c98d616f.tar.gz |
Add check_utf8_print()
This new function looks for problematic code points on output, and warns if any
are found, returning FALSE as well.
What it warns about may change, so is marked as experimental.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1224,6 +1224,9 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp) tmpbuf = bytes_to_utf8((const U8*) tmps, &len); tmps = (char *) tmpbuf; } + else if (ckWARN_d(WARN_UTF8)) { + (void) check_utf8_print((const U8*) tmps, len); + } } else if (DO_UTF8(sv)) { STRLEN tmplen = len; @@ -1240,6 +1243,9 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp) "Wide character in %s", PL_op ? OP_DESC(PL_op) : "print" ); + /* Could also check that isn't one of the things to avoid + * in utf8 by using check_utf8_print(), but not doing so, + * since the stream isn't a UTF8 stream */ } } /* To detect whether the process is about to overstep its |