[#20021] Non-ASCII characters on blender 2.5 alpha 0

could not redo the bug on my system, fix suggested by Yomgui on blendercoders.
This commit is contained in:
Campbell Barton 2009-12-07 10:41:16 +00:00
parent f888903eaf
commit 63fbd76548

@ -313,11 +313,25 @@ void BPY_start_python( int argc, char **argv )
/* sigh, why do python guys not have a char** version anymore? :( */
{
int i;
#if 0
PyObject *py_argv= PyList_New(argc);
for (i=0; i<argc; i++)
PyList_SET_ITEM(py_argv, i, PyUnicode_FromString(argv[i]));
#else // should fix bug #20021 - utf path name problems
PyObject *py_argv= PyList_New(0);
for (i=0; i<argc; i++) {
PyObject *item= PyUnicode_Decode(argv[i], strlen(argv[i]), Py_FileSystemDefaultEncoding, NULL);
if(item==NULL) { // should never happen
PyErr_Print();
PyErr_Clear();
}
else {
PyList_Append(py_argv, item);
Py_DECREF(item);
}
}
#endif
PySys_SetObject("argv", py_argv);
Py_DECREF(py_argv);
}