issue #1027 use unicode filepaths

This commit is contained in:
Sebastian Hoogen
2014-09-21 23:45:32 +02:00
committed by wmayer
parent 7db2cdc008
commit 01cf0f5872
28 changed files with 396 additions and 243 deletions

View File

@@ -108,9 +108,11 @@ using MeshCore::MeshKernel;
static PyObject *
open(PyObject *self, PyObject *args)
{
const char* Name;
if (! PyArg_ParseTuple(args, "s",&Name))
char* Name;
if (!PyArg_ParseTuple(args, "et","utf-8",&Name))
return NULL;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
PY_TRY
{
@@ -125,10 +127,12 @@ open(PyObject *self, PyObject *args)
/* module functions */
static PyObject * insert(PyObject *self, PyObject *args)
{
const char* Name;
char* Name;
const char* DocName;
if (! PyArg_ParseTuple(args, "ss",&Name,&DocName))
if (!PyArg_ParseTuple(args, "ets","utf-8",&Name,&DocName))
return NULL;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
PY_TRY
{
@@ -141,9 +145,11 @@ static PyObject * insert(PyObject *self, PyObject *args)
/* module functions */
static PyObject * read(PyObject *self, PyObject *args)
{
const char* Name;
if (! PyArg_ParseTuple(args, "s",&Name))
char* Name;
if (!PyArg_ParseTuple(args, "et","utf-8",&Name))
return NULL;
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
PY_TRY
{