summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>1999-06-27 00:19:52 +0100
committerGurusamy Sarathy <gsar@cpan.org>1999-07-07 09:45:43 +0000
commit0453d815b8a74697ff1e5451c27aba2fe537b8e0 (patch)
treeb6275867deb61ba13fb0e665d516f115dd9f1d69 /utf8.c
parent69e210baba6414aba2758bc791a6dc3e9e167d9d (diff)
downloadperl-0453d815b8a74697ff1e5451c27aba2fe537b8e0.tar.gz
lexical warnings update (warning.t fails one test
due to leaked scalar, investigation pending) Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB29C6C8E@mbtlipnt02.btlabs.bt.co.uk> Subject: [PATCH 5.005_57] Lexical Warnings - mandatory warning are now default warnings p4raw-id: //depot/perl@3640
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index 8c7aee2d89..4bb2e9bd78 100644
--- a/utf8.c
+++ b/utf8.c
@@ -107,7 +107,9 @@ Perl_utf8_to_uv(pTHX_ U8* s, I32* retlen)
return *s;
}
if (!(uv & 0x40)) {
- Perl_warn(aTHX_ "Malformed UTF-8 character");
+ dTHR;
+ if (ckWARN_d(WARN_UTF8))
+ Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-8 character");
if (retlen)
*retlen = 1;
return *s;
@@ -127,7 +129,9 @@ Perl_utf8_to_uv(pTHX_ U8* s, I32* retlen)
s++;
while (len--) {
if ((*s & 0xc0) != 0x80) {
- Perl_warn(aTHX_ "Malformed UTF-8 character");
+ dTHR;
+ if (ckWARN_d(WARN_UTF8))
+ Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-8 character");
if (retlen)
*retlen -= len + 1;
return 0xfffd;
@@ -203,9 +207,11 @@ Perl_utf16_to_utf8(pTHX_ U16* p, U8* d, I32 bytelen)
continue;
}
if (uv >= 0xd800 && uv < 0xdbff) { /* surrogates */
+ dTHR;
int low = *p++;
if (low < 0xdc00 || low >= 0xdfff) {
- Perl_warn(aTHX_ "Malformed UTF-16 surrogate");
+ if (ckWARN_d(WARN_UTF8))
+ Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-16 surrogate");
p--;
uv = 0xfffd;
}