summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-02-15 11:31:27 -0700
committerKarl Williamson <public@khwilliamson.com>2012-02-15 18:02:35 -0700
commit2e2b25717dbde8d9ce48b4b8dc443e1d08166347 (patch)
treeca10f48aa5a2fa0549aebebed4109a9d8c59aa24 /utf8.c
parentadfec83175578461303ab5cfcc90d37cb3114126 (diff)
downloadperl-2e2b25717dbde8d9ce48b4b8dc443e1d08166347.tar.gz
perl #77654: quotemeta quotes non-ASCII consistently
As described in the pod changes in this commit, this changes quotemeta() to consistenly quote non-ASCII characters when used under unicode_strings. The behavior is changed for these and UTF-8 encoded strings to more closely align with Unicode's recommendations. The end result is that we *could* at some future point start using other characters as metacharacters than the 12 we do now.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index 2a5d93e193..2b1e99b23a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2029,6 +2029,18 @@ Perl_is_utf8_X_LV_LVT_V(pTHX_ const U8 *p)
return is_utf8_common(p, &PL_utf8_X_LV_LVT_V, "_X_LV_LVT_V");
}
+bool
+Perl__is_utf8_quotemeta(pTHX_ const U8 *p)
+{
+ /* For exclusive use of pp_quotemeta() */
+
+ dVAR;
+
+ PERL_ARGS_ASSERT__IS_UTF8_QUOTEMETA;
+
+ return is_utf8_common(p, &PL_utf8_quotemeta, "_Perl_Quotemeta");
+}
+
/*
=for apidoc to_utf8_case