# HG changeset patch # User Bram Moolenaar # Date 1373383855 -7200 # Node ID b3bd43ef012d975cafb7b2a4c41fb78486ee4cc0 # Parent 4c96040b1d9361318530481a9e4ff4ae3bb137a3 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) diff --git a/src/if_python3.c b/src/if_python3.c --- a/src/if_python3.c +++ b/src/if_python3.c @@ -86,7 +86,8 @@ #ifndef PyString_Check # define PyString_Check(obj) PyUnicode_Check(obj) #endif -#define PyString_FromString(repr) PyUnicode_FromString(repr) +#define PyString_FromString(repr) \ + PyUnicode_Decode(repr, STRLEN(repr), ENC_OPT, NULL) #define PyString_FromFormat PyUnicode_FromFormat #ifndef PyInt_Check # define PyInt_Check(obj) PyLong_Check(obj) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 8, +/**/ 7, /**/ 6,