mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
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:
@@ -81,6 +81,18 @@ Storage_Error FSD_BinaryFile::Open(const TCollection_AsciiString& aName,const St
|
||||
SetName(aName);
|
||||
|
||||
if (OpenMode() == Storage_VSNone) {
|
||||
#ifdef _WIN32
|
||||
TCollection_ExtendedString aWName(aName);
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"rb");
|
||||
}
|
||||
else if (aMode == Storage_VSWrite) {
|
||||
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"wb");
|
||||
}
|
||||
else if (aMode == Storage_VSReadWrite) {
|
||||
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"w+b");
|
||||
}
|
||||
#else
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream = fopen(aName.ToCString(),"rb");
|
||||
}
|
||||
@@ -90,6 +102,7 @@ Storage_Error FSD_BinaryFile::Open(const TCollection_AsciiString& aName,const St
|
||||
else if (aMode == Storage_VSReadWrite) {
|
||||
myStream = fopen(aName.ToCString(),"w+b");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (myStream == 0L) {
|
||||
result = Storage_VSOpenError;
|
||||
|
@@ -87,7 +87,18 @@ Storage_Error FSD_CmpFile::Open(const TCollection_AsciiString& aName,const Stora
|
||||
|
||||
if (OpenMode() == Storage_VSNone) {
|
||||
|
||||
#if !defined(IRIX) && !defined(DECOSF1)
|
||||
#if defined(_WNT32)
|
||||
TCollection_ExtendedString aWName(aName);
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream.open((const wchar_t*)aWName.ToExtString(),ios::in|ios::binary); // ios::nocreate is not portable
|
||||
}
|
||||
else if (aMode == Storage_VSWrite) {
|
||||
myStream.open((const wchar_t*)aWName.ToExtString(),ios::out|ios::binary);
|
||||
}
|
||||
else if (aMode == Storage_VSReadWrite) {
|
||||
myStream.open((const wchar_t*)aWName.ToExtString(),ios::in|ios::out|ios::binary);
|
||||
}
|
||||
#elif !defined(IRIX) && !defined(DECOSF1)
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream.open(aName.ToCString(),ios::in|ios::binary); // ios::nocreate is not portable
|
||||
}
|
||||
|
@@ -72,6 +72,18 @@ Storage_Error FSD_File::Open(const TCollection_AsciiString& aName,const Storage_
|
||||
SetName(aName);
|
||||
|
||||
if (OpenMode() == Storage_VSNone) {
|
||||
|
||||
#ifdef _WIN32
|
||||
TCollection_ExtendedString aWName(aName);
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream.open( (const wchar_t*) aWName.ToExtString(),ios::in); // ios::nocreate is not portable
|
||||
}
|
||||
else if (aMode == Storage_VSWrite) {
|
||||
myStream.open( (const wchar_t*) aWName.ToExtString(),ios::out);
|
||||
}
|
||||
else if (aMode == Storage_VSReadWrite) {
|
||||
myStream.open( (const wchar_t*) aWName.ToExtString(),ios::in|ios::out);
|
||||
#else
|
||||
if (aMode == Storage_VSRead) {
|
||||
myStream.open(aName.ToCString(),ios::in); // ios::nocreate is not portable
|
||||
}
|
||||
@@ -80,6 +92,7 @@ Storage_Error FSD_File::Open(const TCollection_AsciiString& aName,const Storage_
|
||||
}
|
||||
else if (aMode == Storage_VSReadWrite) {
|
||||
myStream.open(aName.ToCString(),ios::in|ios::out);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (myStream.fail()) {
|
||||
|
Reference in New Issue
Block a user