From 90c8c7f32b34806076b7f0967cc5feaf10cd5fd6 Mon Sep 17 00:00:00 2001
From: gka <gka@opencascade.com>
Date: Fri, 25 Sep 2015 16:30:29 +0300
Subject: [PATCH] 0026723: Qt IE sample can not import STEP and IGES files with
 names containing not ascii symbols

Added conversion of the names of the imported files in the  Utf8 coding
---
 samples/qt/Interface/src/Translate.cxx | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/samples/qt/Interface/src/Translate.cxx b/samples/qt/Interface/src/Translate.cxx
index a272c038ea..38302dfcec 100755
--- a/samples/qt/Interface/src/Translate.cxx
+++ b/samples/qt/Interface/src/Translate.cxx
@@ -393,8 +393,8 @@ Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file )
 	Handle(TopTools_HSequenceOfShape) aSequence;
     TopoDS_Shape aShape;
 	BRep_Builder aBuilder;
-
-	Standard_Boolean result = BRepTools::Read( aShape, (Standard_CString)file.toLatin1().constData(), aBuilder );
+  TCollection_AsciiString  aFilePath = file.toUtf8().data();
+	Standard_Boolean result = BRepTools::Read( aShape, aFilePath.ToCString(), aBuilder );
 	if ( result )
     {
 	    aSequence = new TopTools_HSequenceOfShape();
@@ -406,8 +406,10 @@ Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file )
 Handle(TopTools_HSequenceOfShape) Translate::importIGES( const QString& file )
 {
     Handle(TopTools_HSequenceOfShape) aSequence;
+    TCollection_AsciiString  aFilePath = file.toUtf8().data();
+      
     IGESControl_Reader Reader;
-    int status = Reader.ReadFile( (Standard_CString)file.toLatin1().constData() );
+    int status = Reader.ReadFile(aFilePath.ToCString() );
 
     if ( status == IFSelect_RetDone )
     {
@@ -422,9 +424,9 @@ Handle(TopTools_HSequenceOfShape) Translate::importIGES( const QString& file )
 Handle(TopTools_HSequenceOfShape) Translate::importSTEP( const QString& file )
 {
 	Handle(TopTools_HSequenceOfShape) aSequence;
-
+  TCollection_AsciiString  aFilePath = file.toUtf8().data();
 	STEPControl_Reader aReader;
-	IFSelect_ReturnStatus status = aReader.ReadFile( (Standard_CString)file.toLatin1().constData() );
+	IFSelect_ReturnStatus status = aReader.ReadFile( aFilePath.ToCString() );
 	if ( status == IFSelect_RetDone )
     {
 	    //Interface_TraceFile::SetDefault();