diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-17 19:11:29 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-17 19:11:29 +0000 |
commit | 507b98002a6c136d628abe928988647938c55cff (patch) | |
tree | 36d66ad5c96f407d248681e66a7b32c94e56c3cf /utf8.c | |
parent | d4742b2c4fb9d3d58f0b4211ec254bb804bb6fd5 (diff) | |
download | perl-507b98002a6c136d628abe928988647938c55cff.tar.gz |
Demote the surrogate and non-character errors to warnings.
p4raw-id: //depot/perl@13740
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -46,11 +46,14 @@ is the recommended Unicode-aware way of saying U8 * Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) { - if (UNICODE_IS_SURROGATE(uv)) - Perl_croak(aTHX_ "UTF-16 surrogate 0x%04"UVxf, uv); - else if ((uv >= 0xFDD0 && uv <= 0xFDEF) || - (uv == 0xFFFE || uv == 0xFFFF)) - Perl_croak(aTHX_ "Unicode character 0x%04"UVxf" is illegal", uv); + if (ckWARN_d(WARN_UTF8)) { + if (UNICODE_IS_SURROGATE(uv)) + Perl_warner(aTHX_ WARN_UTF8, "UTF-16 surrogate 0x%04"UVxf, uv); + else if ((uv >= 0xFDD0 && uv <= 0xFDEF) || + (uv == 0xFFFE || uv == 0xFFFF)) + Perl_warner(aTHX_ WARN_UTF8, + "Unicode character 0x%04"UVxf" is illegal", uv); + } if (UNI_IS_INVARIANT(uv)) { *d++ = UTF_TO_NATIVE(uv); return d; |