Fix wxRegEx::GetMatch() to work in WXREGEX_CONVERT_TO_MB case
Using the offset into the wide string doesn't work for non-ASCII characters, it must be converted to UTF-8 first.
This commit is contained in:
@@ -906,7 +906,11 @@ wxString wxRegEx::GetMatch(const wxString& text, size_t index) const
|
|||||||
if ( !GetMatch(&start, &len, index) )
|
if ( !GetMatch(&start, &len, index) )
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
|
|
||||||
|
#ifndef WXREGEX_CONVERT_TO_MB
|
||||||
return text.Mid(start, len);
|
return text.Mid(start, len);
|
||||||
|
#else
|
||||||
|
return wxString::FromUTF8(text.utf8_str().data() + start, len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxRegEx::GetMatchCount() const
|
size_t wxRegEx::GetMatchCount() const
|
||||||
|
Reference in New Issue
Block a user