diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2006-10-22 23:32:34 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-24 12:53:14 +0000 |
commit | f46fa3876d9373760a3cd5dd806719154ff55bcb (patch) | |
tree | 54a4d7f4044d1e0d749c1090a0b75692d1d15d39 /doio.c | |
parent | 75208dda88c67964167b44f78b4c8a0a93b6aa9c (diff) | |
download | perl-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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)) { |