0022484: UNICODE characters support

Initial UNICODE (UFT-8) characters support for OCCT file operations

Fix for compilation errors and fix for StepFile (avoid objects in pure c code)

Fixes for set unicode symbols to OCAF and visualization
This commit is contained in:
pdn
2014-10-02 15:39:25 +04:00
committed by bugmaster
parent d3dfddaebc
commit d9ff84e8ea
34 changed files with 617 additions and 510 deletions

View File

@@ -192,6 +192,8 @@ Standard_Integer OSD_Process::Error()const{
#include <OSD_Path.hxx>
#include <Quantity_Date.hxx>
#include <Standard_PExtCharacter.hxx>
#include <TCollection_ExtendedString.hxx>
#include <OSD_WNT_1.hxx>
#include <LMCONS.H> /// pour UNLEN ( see MSDN about GetUserName() )
@@ -246,7 +248,7 @@ void OSD_Process :: Spawn ( const TCollection_AsciiString& cmd ,
void OSD_Process :: TerminalType ( TCollection_AsciiString& Name ) {
Name = TEXT( "WIN32 console" );
Name = "WIN32 console";
} // end OSD_Process :: TerminalType
@@ -361,10 +363,14 @@ OSD_Path OSD_Process :: CurrentDirectory () {
OSD_Path anCurrentDirectory;
DWORD dwSize = PATHLEN + 1;
Standard_PCharacter pBuff = new char[dwSize];
Standard_WideChar* pBuff = new wchar_t[dwSize];
if ( GetCurrentDirectory(dwSize, pBuff) > 0 )
anCurrentDirectory = OSD_Path ( pBuff );
if ( GetCurrentDirectoryW(dwSize, (wchar_t*)pBuff) > 0 )
{
// conversion to UTF-8 is performed inside
TCollection_AsciiString aPath(TCollection_ExtendedString((Standard_ExtString)pBuff));
anCurrentDirectory = OSD_Path ( aPath );
}
else
_osd_wnt_set_error ( myError, OSD_WProcess );
@@ -374,17 +380,12 @@ OSD_Path OSD_Process :: CurrentDirectory () {
void OSD_Process :: SetCurrentDirectory ( const OSD_Path& where ) {
#ifdef UNICODE
# define SetCurrentDirectory SetCurrentDirectoryW
#else
# define SetCurrentDirectory SetCurrentDirectoryA
#endif // UNICODE
TCollection_AsciiString path;
where.SystemName ( path );
TCollection_ExtendedString pathW(path);
if ( !::SetCurrentDirectory ( path.ToCString () ) )
if ( !::SetCurrentDirectoryW ( (const wchar_t*) pathW.ToExtString () ) )
_osd_wnt_set_error ( myError, OSD_WProcess );