script.remove( QRegExp("^python.*[\\s]+") );
QString cmd = script+" "+args;
- QString command = QString( "exec(open(\"%1\").read())" ).arg(cmd.trimmed());
+ QString command = QString( "exec(open(\"%1\",encoding='utf-8').read())" ).arg(cmd.trimmed());
pyConsole->exec(command);
}
} // end for loop on pyfiles QStringList
{
onNewDoc();
- QString command = QString("exec(open(\"%1\").read())").arg(aFile);
+ QString command = QString("exec(open(\"%1\",encoding='utf-8').read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( !aFile.isEmpty() )
{
- QString command = QString("exec(open(\"%1\").read())").arg(aFile);
+ QString command = QString("exec(open(\"%1\",encoding='utf-8').read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
} else { // file is not exist on disk
SUIT_MessageBox::warning( desktop(),
QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toLatin1().data()));
+ QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toUtf8().data()));
return false;
}
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
// load study from the temporary directory
- QString command = QString( "exec(open(\"%1\").read())" ).arg( theDumpScript );
+ QString command = QString( "exec(open(\"%1\",encoding='utf-8').read())" ).arg( theDumpScript );
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();