Salome HOME
Unicode support: correct handling of unicode on GUI level
[modules/gui.git] / src / Qtx / Qtx.cxx
index 0fe626c72be3b9b63541fdce106925ac203f2d99..8d98abdb5f8977230b0d71880ec88eb592d24033 100755 (executable)
@@ -543,14 +543,14 @@ QString Qtx::addSlash( const QString& path )
 */
 bool Qtx::dos2unix( const QString& absName )
 {
-  FILE* src = ::fopen( absName.toLatin1(), "rb" );
+  FILE* src = ::fopen( absName.toUtf8(), "rb" );
   if ( !src )
     return false;
 
   /* we'll use temporary file */
   char temp[512] = { '\0' };
   QString dir = Qtx::dir( absName );
-  FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toLatin1(), "__x" ) ), "wb" );
+  FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toUtf8(), "__x" ) ), "wb" );
   if ( !tgt )
     return false;
 
@@ -727,8 +727,8 @@ QString Qtx::makeEnvVarSubst( const QString& str, const SubstMode mode )
         break;
 
       QString newStr;
-      if ( ::getenv( envName.toLatin1() ) || mode == Always )
-        newStr = QString( ::getenv( envName.toLatin1() ) );
+      if ( ::getenv( envName.toUtf8() ) || mode == Always )
+        newStr = QString( ::getenv( envName.toUtf8() ) );
 
       if ( newStr.isNull() )
       {