To: vim_dev@googlegroups.com Subject: Patch 7.4a.008 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 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) Files: src/if_python3.c *** ../vim-7.4a.007/src/if_python3.c 2013-07-03 18:27:35.000000000 +0200 --- src/if_python3.c 2013-07-09 17:23:11.000000000 +0200 *************** *** 86,92 **** #ifndef PyString_Check # define PyString_Check(obj) PyUnicode_Check(obj) #endif ! #define PyString_FromString(repr) PyUnicode_FromString(repr) #define PyString_FromFormat PyUnicode_FromFormat #ifndef PyInt_Check # define PyInt_Check(obj) PyLong_Check(obj) --- 86,93 ---- #ifndef PyString_Check # define PyString_Check(obj) PyUnicode_Check(obj) #endif ! #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) *** ../vim-7.4a.007/src/version.c 2013-07-09 17:08:24.000000000 +0200 --- src/version.c 2013-07-09 17:24:31.000000000 +0200 *************** *** 730,731 **** --- 730,733 ---- { /* Add new patch number below this line */ + /**/ + 8, /**/ -- MICHAEL PALIN PLAYED: 1ST SOLDIER WITH A KEEN INTEREST IN BIRDS, DENNIS, MR DUCK (A VILLAGE CARPENTER WHO IS ALMOST KEENER THAN ANYONE ELSE TO BURN WITCHES), THREE-HEADED KNIGHT, SIR GALAHAD, KING OF SWAMP CASTLE, BROTHER MAYNARD'S ROOMATE "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///