use PyUnicode_DecodeFSDefault rather then PyUnicode_DecodeUTF8(str, strlen(str),...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 5 Dec 2010 09:20:18 +0000 (09:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 5 Dec 2010 09:20:18 +0000 (09:20 +0000)
this is needed because some UTF8 names didnt resolve on windows when using surrogateescape'd strings.

This meant you couldn't export to models some directories on windows.

source/blender/python/generic/py_capi_utils.c

index 8726f416992eb27ff981b5c4244164dbf8abc534..8dfc1ec72b47a3313b44eb3e8ba3fd64e27097ee 100644 (file)
@@ -265,7 +265,8 @@ PyObject *PyC_UnicodeFromByte(const char *str)
        }
        else {
                PyErr_Clear();
-               result= PyUnicode_DecodeUTF8(str, strlen(str), "surrogateescape");
+               /* this means paths will always be accessible once converted, on all OS's */
+               result= PyUnicode_DecodeFSDefault(str);
                return result;
        }
 }