Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-30 12:23:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-30 12:23:48 +0400
commitf7dfb233371adb4064e2cc79cc47084ed89fbbbf (patch)
treeeea7ddd3a5cf2431aed3fdb0c42ba0faab4d6cf4
parent52ca27cc45443bf62dad7ac64930f2695cb1b6f9 (diff)
bugfix [#23197] Python can't handle German umlaut characters in strings
workaround for python bug with Py_CompileString(), reported http://bugs.python.org/msg115202
-rw-r--r--source/blender/python/generic/bpy_internal_import.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 1951e72567c..5dfae400d9b 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -35,6 +35,7 @@
#include "BKE_global.h" /* grr, only for G.sce */
#include "BLI_listbase.h"
#include "BLI_path_util.h"
+#include "BLI_string.h"
#include <stddef.h>
static Main *bpy_import_main= NULL;
@@ -61,6 +62,12 @@ void bpy_import_main_set(struct Main *maggie)
void bpy_text_filename_get(char *fn, Text *text)
{
sprintf(fn, "%s/%s", text->id.lib ? text->id.lib->filepath : G.sce, text->id.name+2);
+
+ /* XXX, this is a bug in python's Py_CompileString()!
+ the string encoding should not be required to be utf-8
+ reported: http://bugs.python.org/msg115202
+ */
+ BLI_utf8_invalid_strip(fn, strlen(fn));
}
PyObject *bpy_text_import( Text *text )