Fix seg fault using Python 2 invalid utf-8 strings and wstring
Fixes seg fault when passing a Python string, containing invalid utf-8 content, to a wstring or wchar * parameter. A TypeError is thrown instead, eg: %include <std_wstring.i> void instring(const std::wstring& s); instring(b"h\xe9llooo") # Python
This commit is contained in:
parent
3915e7bd08
commit
e96316bf31
5 changed files with 57 additions and 4 deletions
|
|
@ -6501,6 +6501,7 @@ void instring(const char *s) {
|
|||
</pre></div>
|
||||
|
||||
<p>
|
||||
Note that "\xe9" is an invalid UTF-8 encoding, but "\xc3\xb6" is valid.
|
||||
When this method is called from Python 3, the return value is the following
|
||||
text string:
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue