Skip to content
Permalink
Browse files
initialize embedded python to UTF-8 mode (fixes #43834)
(cherry picked from commit 61c7973)
  • Loading branch information
jef-n committed Jun 24, 2021
1 parent 66f0b69 commit e7eb1892a66250745e3861a02b027593ab2be2ee
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 e7eb189

Please sign in to comment.