0028353: Samples - IESample cannot write files to paths with special characters
[occt.git] / samples / qt / Common / src / View.cxx
index cc0afa3..ddd32a7 100755 (executable)
@@ -1011,8 +1011,10 @@ void View::onEnvironmentMap()
   {
     QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
                            tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)"));
-
-    Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( fileName.toLatin1().data() );
+    
+    const TCollection_AsciiString anUtf8Path (fileName.toUtf8().data());
+    
+    Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( anUtf8Path );
 
     myView->SetTextureEnv (aTexture);
   }