From: Rafael Garcia-Suarez Date: Sat, 3 Oct 2009 07:56:42 +0000 (+0200) Subject: Change warning "Unicode character is illegal" to more accurate description X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f6ac1dea8501596050bc974dc468632797d51eb;p=p5sagit%2Fp5-mst-13.2.git Change warning "Unicode character is illegal" to more accurate description That now reads "Unicode non-character is illegal in interchange" and the perldiag documentation is expanded a bit. --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 606426f..fb00adc 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -4339,11 +4339,13 @@ Check the #! line, or manually feed your script into Perl yourself. (F) The unexec() routine failed for some reason. See your local FSF representative, who probably put it there in the first place. -=item Unicode character %s is illegal +=item Unicode non-character %s is illegal for interchange -(W utf8) Certain Unicode characters have been designated off-limits by -the Unicode standard and should not be generated. If you really know -what you are doing you can turn off this warning by C. +(W utf8) Certain codepoints, such as U+FFFE and U+FFFF, are defined by the +Unicode standard to be non-characters. Those are legal codepoints, but are +reserved for internal use; so, applications shouldn't attempt to exchange +them. If you know what you are doing you can turn off this warning by +C. =item Unknown BYTEORDER diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8 index 6635f02..be49ae9 100644 --- a/t/lib/warnings/utf8 +++ b/t/lib/warnings/utf8 @@ -62,10 +62,10 @@ my $max = chr(0x10FFFF); EXPECT UTF-16 surrogate 0xd800 at - line 3. UTF-16 surrogate 0xdfff at - line 4. -Unicode character 0xfffe is illegal at - line 8. -Unicode character 0xffff is illegal at - line 9. -Unicode character 0x10fffe is illegal at - line 12. -Unicode character 0x10ffff is illegal at - line 13. +Unicode non-character 0xfffe is illegal for interchange at - line 8. +Unicode non-character 0xffff is illegal for interchange at - line 9. +Unicode non-character 0x10fffe is illegal for interchange at - line 12. +Unicode non-character 0x10ffff is illegal for interchange at - line 13. ######## use warnings 'utf8'; my $d7ff = pack("U", 0xD7FF); @@ -96,10 +96,10 @@ my $max = pack("U", 0x10FFFF); EXPECT UTF-16 surrogate 0xd800 at - line 3. UTF-16 surrogate 0xdfff at - line 4. -Unicode character 0xfffe is illegal at - line 8. -Unicode character 0xffff is illegal at - line 9. -Unicode character 0x10fffe is illegal at - line 12. -Unicode character 0x10ffff is illegal at - line 13. +Unicode non-character 0xfffe is illegal for interchange at - line 8. +Unicode non-character 0xffff is illegal for interchange at - line 9. +Unicode non-character 0x10fffe is illegal for interchange at - line 12. +Unicode non-character 0x10ffff is illegal for interchange at - line 13. ######## use warnings 'utf8'; my $d7ff = "\x{D7FF}"; @@ -130,7 +130,7 @@ my $max = "\x{10FFFF}"; EXPECT UTF-16 surrogate 0xd800 at - line 3. UTF-16 surrogate 0xdfff at - line 4. -Unicode character 0xfffe is illegal at - line 8. -Unicode character 0xffff is illegal at - line 9. -Unicode character 0x10fffe is illegal at - line 12. -Unicode character 0x10ffff is illegal at - line 13. +Unicode non-character 0xfffe is illegal for interchange at - line 8. +Unicode non-character 0xffff is illegal for interchange at - line 9. +Unicode non-character 0x10fffe is illegal for interchange at - line 12. +Unicode non-character 0x10ffff is illegal for interchange at - line 13. diff --git a/t/porting/diag.t b/t/porting/diag.t index 573450d..a9db20c 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -351,7 +351,7 @@ U0 mode on a byte string Unbalanced string table refcount: (%d) for "%s" Undefined top format called Unexpected constant lvalue entersub entry via type/targ %d:%d -Unicode character 0x%04 +Unicode non-character 0x%04 Unknown PerlIO layer "scalar" Unknown Unicode option letter '%c' unrecognised control character '%c' diff --git a/utf8.c b/utf8.c index a68af53..c154fdb 100644 --- a/utf8.c +++ b/utf8.c @@ -127,7 +127,7 @@ Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) !(flags & UNICODE_ALLOW_SUPER)) ) Perl_warner(aTHX_ packWARN(WARN_UTF8), - "Unicode character 0x%04"UVxf" is illegal", uv); + "Unicode non-character 0x%04"UVxf" is illegal for interchange", uv); } if (UNI_IS_INVARIANT(uv)) { *d++ = (U8)UTF_TO_NATIVE(uv);