Salome HOME
Unicode support: correct handling of unicode on GUI level
[modules/gui.git] / src / SalomeApp / SalomeApp_Application.cxx
index 462f1a389ee483d65b36fb32bac035c597eff90e..5779f7b706617fc564186dabe6a896af75c40b20 100644 (file)
@@ -272,7 +272,7 @@ void SalomeApp_Application::start()
 
               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
@@ -497,7 +497,7 @@ void SalomeApp_Application::onNewWithScript()
   {
     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();
@@ -924,7 +924,7 @@ void SalomeApp_Application::onLoadScript( )
 
   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();
@@ -1191,7 +1191,7 @@ int SalomeApp_Application::openChoice( const QString& aName )
   } 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;
   }
 
@@ -1958,7 +1958,7 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
   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();