Skip to content
Permalink
Browse files
initialize embedded python to UTF-8 mode (fixes #43834)
  • Loading branch information
jef-n committed Jun 24, 2021
1 parent 93fe5b0 commit 61c79736d06d234b9b3c023907d37d2b486efd0e
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/python/qgspythonutilsimpl.cpp
@@ -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();

0 comments on commit 61c7973

Please sign in to comment.