summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2006-10-22 23:32:34 +0900
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-24 12:53:14 +0000
commitf46fa3876d9373760a3cd5dd806719154ff55bcb (patch)
tree54a4d7f4044d1e0d749c1090a0b75692d1d15d39 /doio.c
parent75208dda88c67964167b44f78b4c8a0a93b6aa9c (diff)
downloadperl-f46fa3876d9373760a3cd5dd806719154ff55bcb.tar.gz
New UTF-8 warning : Variable length character upgraded in print.
Subject: Re: Changing the internal encoding (was: Re: utf8 regexp performance problem) Message-Id: <20061022142512.A7D3.BQW10602@nifty.com> (but with ckWARN_d replaced by ckWARN) p4raw-id: //depot/perl@29098
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index e0a1fc572a..88afb1dcde 100644
--- a/doio.c
+++ b/doio.c
@@ -1225,9 +1225,14 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
tmps = SvPV_const(sv, len);
if (PerlIO_isutf8(fp)) {
if (!SvUTF8(sv)) {
+ const STRLEN origlen = len;
/* We don't modify the original scalar. */
tmpbuf = bytes_to_utf8((const U8*) tmps, &len);
tmps = (char *) tmpbuf;
+ if (ckWARN(WARN_UTF8) && len != origlen) {
+ Perl_warner(aTHX_ packWARN(WARN_UTF8),
+ "Variable length character upgraded in print");
+ }
}
}
else if (DO_UTF8(sv)) {