From f7dfb233371adb4064e2cc79cc47084ed89fbbbf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 30 Aug 2010 08:23:48 +0000 Subject: [PATCH] bugfix [#23197] Python can't handle German umlaut characters in strings workaround for python bug with Py_CompileString(), reported http://bugs.python.org/msg115202 --- source/blender/python/generic/bpy_internal_import.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 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 )