add escape sequence when executing as Python string

This commit is contained in:
wmayer
2019-09-28 23:35:08 +02:00
parent 426674f225
commit 5de6763ed5
4 changed files with 11 additions and 6 deletions

View File

@@ -505,6 +505,8 @@ void Application::open(const char* FileName, const char* Module)
Base::FileInfo File(FileName);
string te = File.extension();
string unicodepath = Base::Tools::escapedUnicodeFromUtf8(File.filePath().c_str());
unicodepath = Base::Tools::escapeEncodeFilename(unicodepath);
// if the active document is empty and not modified, close it
// in case of an automatically created empty document at startup
App::Document* act = App::GetApplication().getActiveDocument();
@@ -556,6 +558,7 @@ void Application::importFrom(const char* FileName, const char* DocName, const ch
Base::FileInfo File(FileName);
std::string te = File.extension();
string unicodepath = Base::Tools::escapedUnicodeFromUtf8(File.filePath().c_str());
unicodepath = Base::Tools::escapeEncodeFilename(unicodepath);
if (Module != 0) {
try {
@@ -613,6 +616,7 @@ void Application::exportTo(const char* FileName, const char* DocName, const char
Base::FileInfo File(FileName);
std::string te = File.extension();
string unicodepath = Base::Tools::escapedUnicodeFromUtf8(File.filePath().c_str());
unicodepath = Base::Tools::escapeEncodeFilename(unicodepath);
if (Module != 0) {
try {