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/qgis@9663 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 18, 2008
1 parent 6753b48 commit 83678fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/python/qgspythonutilsimpl.cpp
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 83678fc

Please sign in to comment.