\x{} doesn't any more require 'use utf8' outside regexen so why
Jarkko Hietaniemi [Fri, 1 Dec 2000 03:20:39 +0000 (03:20 +0000)]
should it be required inside regexen?

p4raw-id: //depot/perl@7938

regcomp.c
t/op/regmesg.t

index f09e49d..784e83e 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2912,7 +2912,7 @@ tryagain:
                                RExC_parse = p + 1;
                                vFAIL("Missing right brace on \\x{}");
                            }
-                           else if (UTF) {
+                           else {
                                numlen = 1;     /* allow underscores */
                                ender = (UV)scan_hex(p + 1, e - p - 1, &numlen);
                                /* numlen is generous */
@@ -2922,12 +2922,6 @@ tryagain:
                                }
                                p = e + 1;
                            }
-                           else
-                           {
-                               RExC_parse = e + 1;
-                               vFAIL("Can't use \\x{} without 'use utf8' declaration");
-                           }
-
                        }
                        else {
                            numlen = 0;         /* disallow underscores */
index 6b7f52b..50a020b 100644 (file)
@@ -71,8 +71,6 @@ my @death =
 
  'use utf8; /[\x{X]/' => 'Missing right brace on \x{} before {#} mark in regex m/[\x{{#}X]/',
 
- '/\x{x}/' => 'Can\'t use \x{} without \'use utf8\' declaration before {#} mark in regex m/\x{x}{#}/',
-
  '/[[:barf:]]/' => 'POSIX class [:barf:] unknown before {#} mark in regex m/[[:barf:]{#}]/',
 
  '/[[=barf=]]/' => 'POSIX syntax [= =] is reserved for future extensions before {#} mark in regex m/[[=barf=]{#}]/',