Skip to content

Commit efe0ed8

Browse files
committed
updated for version 7.4a.008
Problem: Python 3 doesn't handle multibyte characters prooperly when 'encoding' is not utf-8. Solution: Use PyUnicode_Decode() instead of PyUnicode_FromString(). (Ken Takata)
1 parent 8f9583c commit efe0ed8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/if_python3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
#ifndef PyString_Check
8787
# define PyString_Check(obj) PyUnicode_Check(obj)
8888
#endif
89-
#define PyString_FromString(repr) PyUnicode_FromString(repr)
89+
#define PyString_FromString(repr) \
90+
PyUnicode_Decode(repr, STRLEN(repr), ENC_OPT, NULL)
9091
#define PyString_FromFormat PyUnicode_FromFormat
9192
#ifndef PyInt_Check
9293
# define PyInt_Check(obj) PyLong_Check(obj)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
8,
731733
/**/
732734
7,
733735
/**/

0 commit comments

Comments
 (0)