Skip to content

Commit

Permalink
Allow python plugin's metadata in unicode.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9663 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 18, 2008
1 parent 5b25e64 commit 4c5e483
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/python/qgspythonutilsimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,15 @@ QString QgsPythonUtilsImpl::getPluginMetadata( QString pluginName, QString funct
PyErr_Clear();
retval = "__error__";
}
else if ( PyUnicode_Check( obj ) )
{
PyObject* utf8 = PyUnicode_AsUTF8String( obj );
if (utf8)
retval = QString::fromUtf8( PyString_AS_STRING( utf8 ) );
else
retval = "__error__";
Py_XDECREF( utf8 );
}
else if ( PyString_Check( obj ) )
{
retval = PyString_AS_STRING( obj );
Expand Down

0 comments on commit 4c5e483

Please sign in to comment.