Mercurial > jwe > octave
changeset 27570:74173f04d2a3
Use syntax for UTF-8 mode with PCRE that is used in the configure test (bug #35910).
* regexp.cc (do_regexp_ptn_string_escapes): Revert prepending "(*UTF8)" to the
pattern.
* lo-regexp.cc (compile_internal): Set PCRE_UTF8 when compiling the regular
expression.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sat, 26 Oct 2019 10:56:13 +0200 |
parents | 8edca821f170 |
children | b86adf277734 |
files | libinterp/corefcn/regexp.cc liboctave/util/lo-regexp.cc |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/regexp.cc Fri Oct 25 17:38:08 2019 +0200 +++ b/libinterp/corefcn/regexp.cc Sat Oct 26 10:56:13 2019 +0200 @@ -52,9 +52,9 @@ static std::string do_regexp_ptn_string_escapes (const std::string& s, bool is_sq_str) { - std::string retval = "(*UTF8)"; + std::string retval; - size_t i = 7; + size_t i = 0; size_t j = 0; size_t len = s.length ();
--- a/liboctave/util/lo-regexp.cc Fri Oct 25 17:38:08 2019 +0200 +++ b/liboctave/util/lo-regexp.cc Sat Oct 26 10:56:13 2019 +0200 @@ -234,7 +234,8 @@ = ( (m_options.case_insensitive () ? PCRE_CASELESS : 0) | (m_options.dotexceptnewline () ? 0 : PCRE_DOTALL) | (m_options.lineanchors () ? PCRE_MULTILINE : 0) - | (m_options.freespacing () ? PCRE_EXTENDED : 0)); + | (m_options.freespacing () ? PCRE_EXTENDED : 0) + | PCRE_UTF8); m_data = pcre_compile (buf_str.c_str (), pcre_options, &err, &erroffset, nullptr);