Skip to content

Commit

Permalink
initialize embedded python to UTF-8 mode (fixes #43834)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 24, 2021
1 parent 93fe5b0 commit 61c7973
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/python/qgspythonutilsimpl.cpp
Expand Up @@ -162,6 +162,18 @@ bool QgsPythonUtilsImpl::checkSystemImports()

void QgsPythonUtilsImpl::init()
{
PyStatus status;
PyPreConfig preconfig;
PyPreConfig_InitPythonConfig( &preconfig );

preconfig.utf8_mode = 1;

status = Py_PreInitialize( &preconfig );
if ( PyStatus_Exception( status ) )
{
Py_ExitStatusException( status );
}

// initialize python
Py_Initialize();

Expand Down

0 comments on commit 61c7973

Please sign in to comment.