diff --git a/samples/qt/Common/src/MDIWindow.cxx b/samples/qt/Common/src/MDIWindow.cxx index ee3ced6995..9f3d6aea6a 100755 --- a/samples/qt/Common/src/MDIWindow.cxx +++ b/samples/qt/Common/src/MDIWindow.cxx @@ -128,7 +128,9 @@ void MDIWindow::dump() if ( !QFileInfo( file ).completeSuffix().length() ) file += QString( ".bmp" ); - bool res = myView->dump( (Standard_CString)file.toLatin1().constData() ); + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); + + bool res = myView->dump( anUtf8Path.ToCString() ); QApplication::restoreOverrideCursor(); if ( !res ) { diff --git a/samples/qt/Common/src/View.cxx b/samples/qt/Common/src/View.cxx index cc0afa3711..ddd32a79be 100755 --- a/samples/qt/Common/src/View.cxx +++ b/samples/qt/Common/src/View.cxx @@ -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); } diff --git a/samples/qt/Interface/src/Translate.cxx b/samples/qt/Interface/src/Translate.cxx index 50cb24427f..7a4538bef3 100755 --- a/samples/qt/Interface/src/Translate.cxx +++ b/samples/qt/Interface/src/Translate.cxx @@ -457,7 +457,10 @@ bool Translate::exportBREP( const QString& file, const Handle(TopTools_HSequence return false; TopoDS_Shape shape = shapes->Value( 1 ); - return BRepTools::Write( shape, (Standard_CString)file.toLatin1().constData() ); + + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); + + return BRepTools::Write( shape, anUtf8Path.ToCString() ); } bool Translate::exportIGES( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) @@ -472,7 +475,10 @@ bool Translate::exportIGES( const QString& file, const Handle(TopTools_HSequence for ( int i = 1; i <= shapes->Length(); i++ ) writer.AddShape ( shapes->Value( i ) ); writer.ComputeModel(); - return writer.Write( (Standard_CString)file.toLatin1().constData() ); + + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); + + return writer.Write( anUtf8Path.ToCString() ); } bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes ) @@ -500,8 +506,10 @@ bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequence if ( status != IFSelect_RetDone ) return false; } + + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); - status = writer.Write( (Standard_CString)file.toLatin1().constData() ); + status = writer.Write( anUtf8Path.ToCString() ); switch ( status ) { @@ -539,7 +547,10 @@ bool Translate::exportSTL( const QString& file, const Handle(TopTools_HSequenceO } StlAPI_Writer writer; - writer.Write( res, (Standard_CString)file.toLatin1().constData() ); + + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); + + writer.Write( res, anUtf8Path.ToCString() ); return true; } @@ -565,7 +576,10 @@ bool Translate::exportVRML( const QString& file, const Handle(TopTools_HSequence } VrmlAPI_Writer writer; - writer.Write( res, (Standard_CString)file.toLatin1().constData() ); + + const TCollection_AsciiString anUtf8Path (file.toUtf8().data()); + + writer.Write( res, anUtf8Path.ToCString() ); return true; }