summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Activator.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
committerJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
commit1161c5817059464ab511632c0ce5d14593ced1a3 (patch)
tree51bbcdf2a4ea43c430312157350bb4271bc3f40d /cpp/src/IceGrid/Activator.cpp
parentUpdate .gitignore files (diff)
downloadice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.bz2
ice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.xz
ice-1161c5817059464ab511632c0ce5d14593ced1a3.zip
ICE-4851 - Use wstrings for input and output data that contain non-ASCII characters?
Diffstat (limited to 'cpp/src/IceGrid/Activator.cpp')
-rw-r--r--cpp/src/IceGrid/Activator.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index eb85bb964e6..1b1bb3f6d04 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -377,7 +377,12 @@ Activator::activate(const string& name,
wchar_t absbuf[_MAX_PATH];
wchar_t* fPart;
wstring ext = path.size() <= 4 || path[path.size() - 4] != '.' ? L".exe" : L"";
- if(SearchPathW(NULL, IceUtil::stringToWstring(path).c_str(), ext.c_str(), _MAX_PATH, absbuf, &fPart) == 0)
+
+ //
+ // IceGrid doesn't support to use string converters, so don't need to use
+ // any string converter in wnativeToNative conversions.
+ //
+ if(SearchPathW(NULL, IceUtil::nativeToWnative(0, 0, path).c_str(), ext.c_str(), _MAX_PATH, absbuf, &fPart) == 0)
{
if(_traceLevels->activator > 0)
{
@@ -386,7 +391,7 @@ Activator::activate(const string& name,
}
throw string("Couldn't find `" + path + "' executable.");
}
- path = IceUtil::wstringToString(absbuf);
+ path = IceUtil::wnativeToNative(0, 0, absbuf);
}
else if(!pwd.empty())
{
@@ -397,10 +402,14 @@ Activator::activate(const string& name,
//
// Get the absolute pathname of the working directory.
//
+ // IceGrid doesn't support to use string converters, so
+ // don't need to use any string converter in nativeToWnative
+ // conversions.
+ //
if(!pwd.empty())
{
wchar_t absbuf[_MAX_PATH];
- if(_wfullpath(absbuf, IceUtil::stringToWstring(pwd).c_str(), _MAX_PATH) == NULL)
+ if(_wfullpath(absbuf, IceUtil::nativeToWnative(0, 0, pwd).c_str(), _MAX_PATH) == NULL)
{
if(_traceLevels->activator > 0)
{
@@ -409,7 +418,7 @@ Activator::activate(const string& name,
}
throw string("The server working directory path `" + pwd + "' can't be converted into an absolute path.");
}
- pwd = IceUtil::wstringToString(absbuf);
+ pwd = IceUtil::wnativeToNative(0, 0, absbuf);
}
#endif
@@ -484,13 +493,17 @@ Activator::activate(const string& name,
}
}
- wstring wpwd = IceUtil::stringToWstring(pwd);
+ //
+ // IceGrid doesn't support to use string converters, so don't need to use
+ // any string converter in nativeToWnative conversions.
+ //
+ wstring wpwd = IceUtil::nativeToWnative(0, 0, pwd);
const wchar_t* dir = !wpwd.empty() ? wpwd.c_str() : NULL;
//
// Make a copy of the command line.
//
- wchar_t* cmdbuf = _wcsdup(IceUtil::stringToWstring(cmd).c_str());
+ wchar_t* cmdbuf = _wcsdup(IceUtil::nativeToWnative(0, 0, cmd).c_str());
//
// Create the environment block for the child process. We start with the environment
@@ -530,7 +543,11 @@ Activator::activate(const string& name,
FreeEnvironmentStringsW(static_cast<wchar_t*>(parentEnv));
for(StringSeq::const_iterator p = envs.begin(); p != envs.end(); ++p)
{
- wstring s = IceUtil::stringToWstring(*p);
+ //
+ // IceGrid doesn't support to use string converters, so don't need to use
+ // any string converter in nativeToWnative conversions.
+ //
+ wstring s = IceUtil::nativeToWnative(0, 0, *p);
wstring::size_type pos = s.find(L'=');
if(pos != wstring::npos)
{