summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-17 19:11:29 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-17 19:11:29 +0000
commit507b98002a6c136d628abe928988647938c55cff (patch)
tree36d66ad5c96f407d248681e66a7b32c94e56c3cf /utf8.c
parentd4742b2c4fb9d3d58f0b4211ec254bb804bb6fd5 (diff)
downloadperl-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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/utf8.c b/utf8.c
index 0979506f76..af365927e2 100644
--- a/utf8.c
+++ b/utf8.c
@@ -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;