1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0022898: IGES import fails in german environment

Added DRAW command dlocale to set and query current locale of the C subsystem
Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale)
In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define
Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod()
Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer
Changes of global locale are eliminated throughout OCCT code
Proposed correction for GNU libC where v*printf_l functions are absent
Added test case (bugs xde bug22898) for data exchange operations with non-standard locale
Use xlocale on Mac OS X and within glibc
Corrected strtod_l wrapper
Generate error rather than warning
Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer
Standard_CLocaleSentry - copy locale string
Standard_CLocaleSentry - use _configthreadlocale on Windows
Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void*
Corrected misprint in ~Standard_CLocaleSentry()
Use French locale in bug22898 test case
Mark test case as skipped if locale is unavailable on tested system.
Use fr_FR locale for tests on Mac OS X
This commit is contained in:
abv
2013-02-01 18:41:16 +04:00
parent 3bea4c165c
commit 91322f44fd
203 changed files with 2707 additions and 2807 deletions

View File

@@ -108,10 +108,6 @@ void XmlLDrivers_DocumentStorageDriver::Write
(const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName)
{
const TCollection_AsciiString anOldNumLocale =
(Standard_CString) setlocale (LC_NUMERIC, NULL);
setlocale(LC_NUMERIC, "C");
Handle(CDM_MessageDriver) aMessageDriver =
theDocument -> Application() -> MessageDriver();
::take_time (~0, " +++++ Start STORAGE procedures ++++++", aMessageDriver);
@@ -143,7 +139,6 @@ void XmlLDrivers_DocumentStorageDriver::Write
Standard_Failure::Raise("File cannot be opened for writing");
}
}
setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
}
//=======================================================================
@@ -402,7 +397,7 @@ static void take_time (const Standard_Integer isReset, const char * aHeader,
if (isReset) tmbuf0 = tmbuf;
else {
char take_tm_buf [64];
sprintf (take_tm_buf, "%9.2f s ++++",
Sprintf (take_tm_buf, "%9.2f s ++++",
double(tmbuf.time - tmbuf0.time) +
double(tmbuf.millitm - tmbuf0.millitm)/1000.);
aMessage += take_tm_buf;