allow "\x{12ab}" even without C<use utf8>
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 6 Feb 2000 13:59:58 +0000 (13:59 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 6 Feb 2000 13:59:58 +0000 (13:59 +0000)
p4raw-id: //depot/perl@5000

t/pragma/warn/toke
toke.c

index 515241a..48f97dd 100644 (file)
@@ -89,10 +89,6 @@ toke.c       AOK
        sub time {} 
        my $a = time()
 
-    Use of \\x{} without utf8 declaration
-       $_ = " \x{123} " ;
-
-
     \x%.*s will produce malformed UTF-8 character; use \x{%.*s} for that
         use utf8 ; 
        $_ = "\xffe"
@@ -440,18 +436,7 @@ EXPECT
 Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
 ########
 # toke.c
-use warnings 'utf8' ;
-eval <<'EOE';
-{
-#line 30 "foo"
-  $_ = " \x{123} " ;
-}
-EOE
-EXPECT
-Use of \x{} without utf8 declaration at foo line 30.
-########
-# toke.c
-no warnings 'utf8' ;
+use warnings ;
 eval <<'EOE';
 {
 #line 30 "foo"
diff --git a/toke.c b/toke.c
index 22db523..e1eb817 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1352,12 +1352,6 @@ S_scan_const(pTHX_ char *start)
                        yyerror("Missing right brace on \\x{}");
                        e = s;
                    }
-                   if (!utf) {
-                       dTHR;
-                       if (ckWARN(WARN_UTF8))
-                           Perl_warner(aTHX_ WARN_UTF8,
-                                  "Use of \\x{} without utf8 declaration");
-                   }
                    /* note: utf always shorter than hex */
                    d = (char*)uv_to_utf8((U8*)d,
                                          (UV)scan_hex(s + 1, e - s - 1, &len));