diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index 2e35f1aa35..949e02ab4f 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -277,7 +277,7 @@ bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, if( s_PcbEditFrame ) { bool ok = s_PcbEditFrame->ExportVRML_File( aFullFileName, aMMtoWRMLunit, - aExport3DFiles, aUseRelativePaths, + aExport3DFiles, aUseRelativePaths, aUsePlainPCB, a3D_Subdir, aXRef, aYRef ); return ok; } diff --git a/scripting/kicadplugins.i b/scripting/kicadplugins.i index e4e2b74be0..1f7eeb6dc7 100644 --- a/scripting/kicadplugins.i +++ b/scripting/kicadplugins.i @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -67,21 +67,24 @@ NOT_LOADED_WIZARDS="" """ PLUGIN_DIRECTORIES_SEARCH="" -""" the trace of errors during execution of footprint wizards scripts """ + the trace of errors during execution of footprint wizards scripts + Warning: strings (internally unicode) are returned as UTF-8 compatible C strings +""" + FULL_BACK_TRACE="" def GetUnLoadableWizards(): global NOT_LOADED_WIZARDS - return NOT_LOADED_WIZARDS + return NOT_LOADED_WIZARDS.encode( 'UTF-8' ) def GetWizardsSearchPaths(): global PLUGIN_DIRECTORIES_SEARCH - return PLUGIN_DIRECTORIES_SEARCH + return PLUGIN_DIRECTORIES_SEARCH.encode( 'UTF-8' ) def GetWizardsBackTrace(): global FULL_BACK_TRACE - return FULL_BACK_TRACE + return FULL_BACK_TRACE.encode( 'UTF-8' ) def LoadPluginModule(Dirname, ModuleName, FileName): @@ -153,6 +156,7 @@ def LoadPlugins(bundlepath=None, userpath=None): Initialise Scripting/Plugin python environment and load plugins. Arguments: + Note: bundlepath and userpath are given utf8 encoded, to be compatible with asimple C string bundlepath -- The path to the bundled scripts. The bundled Plugins are relative to this path, in the "plugins" subdirectory. @@ -184,6 +188,13 @@ def LoadPlugins(bundlepath=None, userpath=None): import importlib importlib.invalidate_caches() + """ + bundlepath and userpath are strings utf-8 encoded (compatible "C" strings). + So convert these utf8 encoding to unicode strings to avoid any encoding issue. + """ + bundlepath = bundlepath.decode( 'UTF-8' ); + userpath = userpath.decode( 'UTF-8' ); + config_path = pcbnew.SETTINGS_MANAGER.GetUserSettingsPath() plugin_directories=[]