summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-02-15 12:27:23 -0700
committerKarl Williamson <public@khwilliamson.com>2012-02-15 18:02:35 -0700
commit20adcf7c80fc3ad8cffa7d52b95a40d87bd781d0 (patch)
tree42b6ebc3be70e41366f78282be3e658182a06468 /pp.c
parent29050de536086566fb4d4a9db818b8068dd118a0 (diff)
downloadperl-20adcf7c80fc3ad8cffa7d52b95a40d87bd781d0.tar.gz
pp_quote_meta: in locale, quote all UTF-8 Latin1 non-ASCII
Under locale rules, this commit quotes all non-ASCII Latin1 characters in UTF-8 encoded strings. This provides consistency with this function and other functions, such as lc().
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index a2b34b30eb..f1d79f7b0a 100644
--- a/pp.c
+++ b/pp.c
@@ -4097,7 +4097,11 @@ PP(pp_quotemeta)
}
}
else if (UTF8_IS_DOWNGRADEABLE_START(*s)) {
- if (_isQUOTEMETA(TWO_BYTE_UTF8_TO_UNI(*s, *(s + 1))))
+
+ /* In locale, we quote all non-ASCII Latin1 chars.
+ * Otherwise use the quoting rules */
+ if (IN_LOCALE_RUNTIME
+ || _isQUOTEMETA(TWO_BYTE_UTF8_TO_UNI(*s, *(s + 1))))
{
to_quote = TRUE;
}