summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 3f4d6345c5..e7ec7e05ae 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -6996,7 +6996,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
U32 posflags = 0, negflags = 0;
U32 *flagsp = &posflags;
bool has_charset_modifier = 0;
- regex_charset cs = REGEX_DEPENDS_CHARSET;
+ regex_charset cs = (RExC_utf8 || RExC_uni_semantics)
+ ? REGEX_UNICODE_CHARSET
+ : REGEX_DEPENDS_CHARSET;
while (*RExC_parse) {
/* && strchr("iogcmsx", *RExC_parse) */