SALOMEDS::Locker lock;
aURL = _local_impl->URL();
}
- else {
- wchar_t* wurl = _corba_impl->URL();
-
- // Converts unicode url to encoded version
- setlocale(LC_ALL, "");
- size_t urlLen = std::wcslen(wurl);
- char url[urlLen+1];
- memset( url, 0, urlLen+1);
- wcstombs(url, wurl, sizeof(url));
-
- aURL = std::string(url);
- }
+ else
+ aURL = Kernel_Utils::encode_s(_corba_impl->URL());
return aURL;
}
SALOMEDS::Locker lock;
_local_impl->URL(url);
}
- else {
- setlocale(LC_ALL, "");
- size_t urlLen = url.size();
- wchar_t wurl[urlLen+1];
- memset( wurl, 0, urlLen+1);
- mbstowcs(wurl, url.c_str(), sizeof(wurl));
-
- _corba_impl->URL(wurl);
- }
+ else _corba_impl->URL(Kernel_Utils::decode_s(url));
}
int SALOMEDS_Study::StudyId()
Unexpect aCatch(SalomeException);
- // Converts unicode url to encoded version
- setlocale(LC_ALL, "");
- size_t urlLen = std::wcslen(aWUrl);
- char aUrl[urlLen+1];
- memset( aUrl, 0, urlLen+1);
- wcstombs(aUrl, aWUrl, sizeof(aUrl));
+ std::string aUrl = Kernel_Utils::encode_s(aWUrl);
+
MESSAGE("Begin of SALOMEDS_StudyManager_i::Open " << aUrl << " (" << urlLen << ")");
}
#endif // ;ALLOW_MULTI_STUDIES
- SALOMEDSImpl_Study* aStudyImpl = _impl->Open(std::string(aUrl));
+ SALOMEDSImpl_Study* aStudyImpl = _impl->Open(aUrl);
if ( !aStudyImpl ) {
- std::string errmsg = "Impossible to Open study from file " + std::string(aUrl);
+ std::string errmsg = "Impossible to Open study from file " + aUrl;
THROW_SALOME_CORBA_EXCEPTION(errmsg.c_str(), SALOME::BAD_PARAM)
}
}
SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAs(std::string(Kernel_Utils::encode(aWUrl)), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAs(Kernel_Utils::encode_s(aWUrl), aStudyImpl, _factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const wchar_t* aWUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile)
}
SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAsASCII(std::string(Kernel_Utils::encode(aWUrl)), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAsASCII(Kernel_Utils::encode_s(aWUrl), aStudyImpl, _factory, theMultiFile);
}
//============================================================================
{
for (unsigned int ind=0; ind < aLength; ind++)
{
- SCRUTE(anOpened[ind]->Name()) ;
_list_open_studies[ind] = CORBA::wstring_dup(Kernel_Utils::decode_s(anOpened[ind]->Name()));
SCRUTE(Kernel_Utils::encode(_list_open_studies[ind])) ;
}