summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-09 17:30:55 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-09 17:30:55 +0200
commite032461eede2a80f184f1c08e22a76eaf18a480e (patch)
treeb0ca53997ffe6a103c6986305ac6d8506e796689
parentb69510e889a1eb102bce83567a7b958d2f25b6ff (diff)
downloadvim-git-e032461eede2a80f184f1c08e22a76eaf18a480e.tar.gz
updated for version 7.4a.008v7.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)
-rw-r--r--src/if_python3.c3
-rw-r--r--src/version.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 8a7a3a4b1..8a5b3329e 100644
--- 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
index 02086c766..5f8df7731 100644
--- 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,