summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Application.cpp7
-rw-r--r--cpp/src/Ice/Initialize.cpp6
-rw-r--r--cpp/src/Ice/InputStream.cpp106
-rw-r--r--cpp/src/Ice/Instance.cpp24
-rw-r--r--cpp/src/Ice/Instance.h4
-rw-r--r--cpp/src/Ice/LoggerI.cpp11
-rw-r--r--cpp/src/Ice/LoggerI.h3
-rw-r--r--cpp/src/Ice/OutputStream.cpp64
-rw-r--r--cpp/src/Ice/PropertiesI.cpp23
-rw-r--r--cpp/src/Ice/PropertiesI.h14
-rw-r--r--cpp/src/Ice/Service.cpp3
-rwxr-xr-xcpp/src/IceSSL/Certificate.cpp1
-rw-r--r--cpp/src/IceSSL/SChannelEngine.cpp1
-rwxr-xr-xcpp/src/IceSSL/Util.cpp1
-rw-r--r--cpp/src/IceUtil/StringConverter.cpp9
15 files changed, 142 insertions, 135 deletions
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index 96be888b7c9..4b81f69614e 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -314,7 +314,7 @@ Ice::Application::main(int argc, char* argv[], const char* configFile)
if(argc > 0 && argv[0] && ICE_DYNAMIC_CAST(LoggerI, getProcessLogger()))
{
- setProcessLogger(ICE_MAKE_SHARED(LoggerI, argv[0], "", true, Ice::getProcessStringConverter()));
+ setProcessLogger(ICE_MAKE_SHARED(LoggerI, argv[0], "", true));
}
InitializationData initData;
@@ -369,7 +369,7 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
const bool convert = initializationData.properties ?
initializationData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initializationData.properties->getProperty("Ice.StdErr").empty() : true;
- setProcessLogger(ICE_MAKE_SHARED(LoggerI, argv[0], "", convert, Ice::getProcessStringConverter()));
+ setProcessLogger(ICE_MAKE_SHARED(LoggerI, argv[0], "", convert));
}
if(IceInternal::Application::_communicator != 0)
@@ -661,8 +661,7 @@ Ice::Application::doMain(int argc, char* argv[], const InitializationData& initD
initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initData.properties->getProperty("Ice.StdErr").empty();
- setProcessLogger(ICE_MAKE_SHARED(LoggerI, initData.properties->getProperty("Ice.ProgramName"), "", convert,
- Ice::getProcessStringConverter()));
+ setProcessLogger(ICE_MAKE_SHARED(LoggerI, initData.properties->getProperty("Ice.ProgramName"), "", convert));
}
IceInternal::Application::_communicator = initialize(argc, argv, initData);
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index baccbcb50cd..52f03678659 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -122,13 +122,13 @@ Ice::stringSeqToArgs(const StringSeq& args, int& argc, char* argv[])
PropertiesPtr
Ice::createProperties()
{
- return PropertiesPtr(new PropertiesI(getProcessStringConverter()));
+ return ICE_MAKE_SHARED(PropertiesI);
}
PropertiesPtr
Ice::createProperties(StringSeq& args, const PropertiesPtr& defaults)
{
- return PropertiesPtr(new PropertiesI(args, defaults, getProcessStringConverter()));
+ return ICE_MAKE_SHARED(PropertiesI, args, defaults);
}
PropertiesPtr
@@ -272,7 +272,7 @@ Ice::getProcessLogger()
//
// TODO: Would be nice to be able to use process name as prefix by default.
//
- processLogger = ICE_MAKE_SHARED(LoggerI, "", "", true, getProcessStringConverter());
+ processLogger = ICE_MAKE_SHARED(LoggerI, "", "", true);
}
return processLogger;
}
diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp
index 912c1b2b425..7563f412ae4 100644
--- a/cpp/src/Ice/InputStream.cpp
+++ b/cpp/src/Ice/InputStream.cpp
@@ -23,6 +23,7 @@
#include <Ice/TraceLevels.h>
#include <Ice/LoggerUtil.h>
#include <Ice/SlicedData.h>
+#include <Ice/StringConverter.h>
#include <iterator>
#ifndef ICE_UNALIGNED
@@ -35,6 +36,7 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;
+
Ice::InputStream::InputStream()
{
initialize(currentEncoding);
@@ -161,9 +163,6 @@ Ice::InputStream::initialize(Instance* instance, const EncodingVersion& encoding
_instance = instance;
- _stringConverter = _instance->getStringConverter();
- _wstringConverter = _instance->getWstringConverter();
-
#ifndef ICE_CPP11_MAPPING
_collectObjects = _instance->collectObjects();
#endif
@@ -201,13 +200,6 @@ Ice::InputStream::clear()
}
void
-Ice::InputStream::setStringConverters(const StringConverterPtr& sc, const WstringConverterPtr& wsc)
-{
- _stringConverter = sc;
- _wstringConverter = wsc;
-}
-
-void
Ice::InputStream::setValueFactoryManager(const ValueFactoryManagerPtr& vfm)
{
_valueFactoryManager = vfm;
@@ -288,8 +280,6 @@ Ice::InputStream::swap(InputStream& other)
std::swap(_startSeq, other._startSeq);
std::swap(_minSeqSize, other._minSeqSize);
- std::swap(_stringConverter, other._stringConverter);
- std::swap(_wstringConverter, other._wstringConverter);
std::swap(_valueFactoryManager, other._valueFactoryManager);
std::swap(_logger, other._logger);
std::swap(_compactIdResolver, other._compactIdResolver);
@@ -1140,7 +1130,7 @@ Ice::InputStream::read(std::string& v, bool convert)
{
throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
- if(convert && _stringConverter)
+ if(convert)
{
readConverted(v, sz);
}
@@ -1168,7 +1158,7 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize, bool convert)
throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
}
- if(convert == false || !_stringConverter)
+ if(convert == false)
{
vdata = reinterpret_cast<const char*>(&*i);
vsize = static_cast<size_t>(sz);
@@ -1231,32 +1221,24 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize)
void
Ice::InputStream::read(const char*& vdata, size_t& vsize, string& holder)
{
- if(!_stringConverter)
+ Int sz = readSize();
+ if(sz > 0)
{
- holder.clear();
- read(vdata, vsize);
+ if(b.end() - i < sz)
+ {
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+
+ readConverted(holder, sz);
+ i += sz;
+ vdata = holder.data();
+ vsize = holder.size();
}
else
{
- Int sz = readSize();
- if(sz > 0)
- {
- if(b.end() - i < sz)
- {
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
-
- readConverted(holder, sz);
- i += sz;
- vdata = holder.data();
- vsize = holder.size();
- }
- else
- {
- holder.clear();
- vdata = 0;
- vsize = 0;
- }
+ holder.clear();
+ vdata = 0;
+ vsize = 0;
}
}
#endif
@@ -1264,16 +1246,35 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize, string& holder)
void
Ice::InputStream::readConverted(string& v, int sz)
{
- if(!_stringConverter)
- {
- throw MarshalException(__FILE__, __LINE__, "no string converter provided");
- }
-
try
{
- _stringConverter->fromUTF8(i, i + sz, v);
+ bool converted = false;
+
+ if(_instance)
+ {
+ const StringConverterPtr& stringConverter = _instance->getStringConverter();
+ if(stringConverter)
+ {
+ stringConverter->fromUTF8(i, i + sz, v);
+ converted = true;
+ }
+ }
+ else
+ {
+ StringConverterPtr stringConverter = getProcessStringConverter();
+ if(stringConverter)
+ {
+ stringConverter->fromUTF8(i, i + sz, v);
+ converted = true;
+ }
+ }
+
+ if(!converted)
+ {
+ string(reinterpret_cast<const char*>(&*i), reinterpret_cast<const char*>(&*i) + sz).swap(v);
+ }
}
- catch(const IceUtil::IllegalConversionException& ex)
+ catch(const IllegalConversionException& ex)
{
throw StringConversionException(__FILE__, __LINE__, ex.reason());
}
@@ -1300,11 +1301,6 @@ Ice::InputStream::read(vector<string>& v, bool convert)
void
Ice::InputStream::read(wstring& v)
{
- if(!_wstringConverter)
- {
- throw MarshalException(__FILE__, __LINE__, "no wstring converter provided");
- }
-
Int sz = readSize();
if(sz > 0)
{
@@ -1315,10 +1311,20 @@ Ice::InputStream::read(wstring& v)
try
{
- _wstringConverter->fromUTF8(i, i + sz, v);
+ if(_instance)
+ {
+ const WstringConverterPtr& wstringConverter = _instance->getWstringConverter();
+ wstringConverter->fromUTF8(i, i + sz, v);
+ }
+ else
+ {
+ WstringConverterPtr wstringConverter = getProcessWstringConverter();
+ wstringConverter->fromUTF8(i, i + sz, v);
+ }
+
i += sz;
}
- catch(const IceUtil::IllegalConversionException& ex)
+ catch(const IllegalConversionException& ex)
{
throw StringConversionException(__FILE__, __LINE__, ex.reason());
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index d1d5634b2ca..cf9e6067652 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -1116,7 +1116,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
#endif
if(!logfile.empty())
{
- _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), logfile, true, ICE_NULLPTR,
+ _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), logfile, true,
_initData.properties->getPropertyAsIntWithDefault("Ice.LogFile.SizeMax", 0));
}
else
@@ -1124,8 +1124,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_initData.logger = getProcessLogger();
if(ICE_DYNAMIC_CAST(Logger, _initData.logger))
{
- _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), "",
- logStdErrConvert, _stringConverter);
+ _initData.logger = ICE_MAKE_SHARED(LoggerI, _initData.properties->getProperty("Ice.ProgramName"), "", logStdErrConvert);
}
}
}
@@ -1249,14 +1248,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_retryQueue = new RetryQueue(this);
- //
- // When _wstringConverter isn't set, use the default Unicode wstring converter
- //
- if(!_wstringConverter)
- {
- _wstringConverter = IceUtil::createUnicodeWstringConverter();
- }
-
__setNoDelete(false);
}
catch(...)
@@ -1344,16 +1335,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
// Reset _stringConverter and _wstringConverter, in case a plugin changed them
//
_stringConverter = Ice::getProcessStringConverter();
-
- Ice::WstringConverterPtr newWstringConverter = Ice::getProcessWstringConverter();
- if(newWstringConverter)
- {
- _wstringConverter = newWstringConverter;
- }
- else
- {
- _wstringConverter = IceUtil::createUnicodeWstringConverter();
- }
+ _wstringConverter = Ice::getProcessWstringConverter();
//
// Create Admin facets, if enabled.
diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h
index 659eef3157f..22a39169c38 100644
--- a/cpp/src/Ice/Instance.h
+++ b/cpp/src/Ice/Instance.h
@@ -135,8 +135,8 @@ public:
void setThreadHook(const Ice::ThreadNotificationPtr&);
#endif
- Ice::StringConverterPtr getStringConverter() const { return _stringConverter; }
- Ice::WstringConverterPtr getWstringConverter() const { return _wstringConverter; }
+ const Ice::StringConverterPtr& getStringConverter() const { return _stringConverter; }
+ const Ice::WstringConverterPtr& getWstringConverter() const { return _wstringConverter; }
BufSizeWarnInfo getBufSizeWarn(Ice::Short type);
void setSndBufSizeWarn(Ice::Short type, int size);
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp
index b94b713a740..0b135e08987 100644
--- a/cpp/src/Ice/LoggerI.cpp
+++ b/cpp/src/Ice/LoggerI.cpp
@@ -52,11 +52,10 @@ const IceUtil::Time retryTimeout = IceUtil::Time::seconds(5 * 60);
}
Ice::LoggerI::LoggerI(const string& prefix, const string& file,
- bool convert, const StringConverterPtr& converter,
- size_t sizeMax) :
+ bool convert, size_t sizeMax) :
_prefix(prefix),
_convert(convert),
- _converter(converter),
+ _converter(getProcessStringConverter()),
#if defined(_WIN32) && !defined(ICE_OS_WINRT)
_consoleConverter(createWindowsStringConverter(GetConsoleOutputCP())),
#endif
@@ -131,7 +130,8 @@ Ice::LoggerI::getPrefix()
LoggerPtr
Ice::LoggerI::cloneWithPrefix(const std::string& prefix)
{
- return ICE_MAKE_SHARED(LoggerI, prefix, _file, _convert, _converter);
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(outputMutex); // for _sizeMax
+ return ICE_MAKE_SHARED(LoggerI, prefix, _file, _convert, _sizeMax);
}
void
@@ -227,8 +227,7 @@ Ice::LoggerI::write(const string& message, bool indent)
error("FileLogger: cannot open `" + _file + "':\nlog messages will be sent to stderr");
write(message, indent);
return;
- }
- }
+ } }
}
_out << s << endl;
}
diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h
index 3ab62255d34..5c75dbd12b8 100644
--- a/cpp/src/Ice/LoggerI.h
+++ b/cpp/src/Ice/LoggerI.h
@@ -21,8 +21,7 @@ class LoggerI : public Logger
{
public:
- LoggerI(const std::string&, const std::string&, bool convert = true,
- const StringConverterPtr& converter = 0, std::size_t sizeMax = 0);
+ LoggerI(const std::string&, const std::string&, bool convert = true, std::size_t sizeMax = 0);
~LoggerI();
virtual void print(const std::string&);
diff --git a/cpp/src/Ice/OutputStream.cpp b/cpp/src/Ice/OutputStream.cpp
index 45d649131fa..4850b0f5474 100644
--- a/cpp/src/Ice/OutputStream.cpp
+++ b/cpp/src/Ice/OutputStream.cpp
@@ -20,6 +20,7 @@
#include <Ice/TraceUtil.h>
#include <Ice/LoggerUtil.h>
#include <Ice/SlicedData.h>
+#include <Ice/StringConverter.h>
#include <iterator>
using namespace std;
@@ -134,9 +135,6 @@ Ice::OutputStream::initialize(Instance* instance, const EncodingVersion& encodin
_instance = instance;
_encoding = encoding;
- _stringConverter = _instance->getStringConverter();
- _wstringConverter = _instance->getWstringConverter();
-
_format = _instance->defaultsAndOverrides()->defaultFormat;
}
@@ -152,13 +150,6 @@ Ice::OutputStream::clear()
}
void
-Ice::OutputStream::setStringConverters(const StringConverterPtr& sc, const WstringConverterPtr& wsc)
-{
- _stringConverter = sc;
- _wstringConverter = wsc;
-}
-
-void
Ice::OutputStream::setFormat(FormatType fmt)
{
_format = fmt;
@@ -602,11 +593,6 @@ Ice::OutputStream::write(const char*)
void
Ice::OutputStream::writeConverted(const char* vdata, size_t vsize)
{
- if(!_stringConverter)
- {
- throw MarshalException(__FILE__, __LINE__, "no string converter provided");
- }
-
//
// What is the size of the resulting UTF-8 encoded string?
// Impossible to tell, so we guess. If we don't guess correctly,
@@ -620,7 +606,35 @@ Ice::OutputStream::writeConverted(const char* vdata, size_t vsize)
size_t firstIndex = b.size();
StreamUTF8BufferI buffer(*this);
- Byte* lastByte = _stringConverter->toUTF8(vdata, vdata + vsize, buffer);
+ Byte* lastByte = ICE_NULLPTR;
+ bool converted = false;
+ if(_instance)
+ {
+ const StringConverterPtr& stringConverter = _instance->getStringConverter();
+ if(stringConverter)
+ {
+ lastByte = stringConverter->toUTF8(vdata, vdata + vsize, buffer);
+ converted = true;
+ }
+ }
+ else
+ {
+ StringConverterPtr stringConverter = getProcessStringConverter();
+ if(stringConverter)
+ {
+ lastByte = stringConverter->toUTF8(vdata, vdata + vsize, buffer);
+ converted = true;
+ }
+ }
+
+ if(!converted)
+ {
+ Container::size_type position = b.size();
+ resize(position + vsize);
+ memcpy(&b[position], vdata, vsize);
+ return;
+ }
+
if(lastByte != b.end())
{
resize(lastByte - b.begin());
@@ -691,11 +705,6 @@ Ice::OutputStream::write(const wstring& v)
return;
}
- if(!_wstringConverter)
- {
- throw MarshalException(__FILE__, __LINE__, "no wstring converter provided");
- }
-
//
// What is the size of the resulting UTF-8 encoded string?
// Impossible to tell, so we guess. If we don't guess correctly,
@@ -709,7 +718,18 @@ Ice::OutputStream::write(const wstring& v)
size_t firstIndex = b.size();
StreamUTF8BufferI buffer(*this);
- Byte* lastByte = _wstringConverter->toUTF8(v.data(), v.data() + v.size(), buffer);
+ Byte* lastByte = ICE_NULLPTR;
+
+ // Note: wstringConverter is never null; when set to null, get returns the default unicode wstring converter
+ if(_instance)
+ {
+ lastByte = _instance->getWstringConverter()->toUTF8(v.data(), v.data() + v.size(), buffer);
+ }
+ else
+ {
+ lastByte = getProcessWstringConverter()->toUTF8(v.data(), v.data() + v.size(), buffer);
+ }
+
if(lastByte != b.end())
{
resize(lastByte - b.begin());
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index d348255cda5..f3461f47320 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -296,6 +296,8 @@ Ice::PropertiesI::parseIceCommandLineOptions(const StringSeq& options)
void
Ice::PropertiesI::load(const std::string& file)
{
+ StringConverterPtr stringConverter = getProcessStringConverter();
+
//
// Metro style applications cannot access Windows registry.
//
@@ -303,7 +305,7 @@ Ice::PropertiesI::load(const std::string& file)
if(file.find("HKLM\\") == 0)
{
HKEY iceKey;
- const wstring keyName = stringToWstring(file, _converter).substr(5).c_str();
+ const wstring keyName = stringToWstring(file, stringConverter).substr(5).c_str();
LONG err;
if((err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, keyName.c_str(), 0, KEY_QUERY_VALUE, &iceKey)) != ERROR_SUCCESS)
{
@@ -351,7 +353,7 @@ Ice::PropertiesI::load(const std::string& file)
continue;
}
string name = wstringToString(
- wstring(reinterpret_cast<wchar_t*>(&nameBuf[0]), nameBufSize), _converter);
+ wstring(reinterpret_cast<wchar_t*>(&nameBuf[0]), nameBufSize), stringConverter);
if(keyType != REG_SZ && keyType != REG_EXPAND_SZ)
{
ostringstream os;
@@ -364,7 +366,7 @@ Ice::PropertiesI::load(const std::string& file)
wstring valueW = wstring(reinterpret_cast<wchar_t*>(&dataBuf[0]), (dataBufSize / sizeof(wchar_t)) - 1);
if(keyType == REG_SZ)
{
- value = wstringToString(valueW, _converter);
+ value = wstringToString(valueW, stringConverter);
}
else // keyType == REG_EXPAND_SZ
{
@@ -384,7 +386,7 @@ Ice::PropertiesI::load(const std::string& file)
continue;
}
}
- value = wstringToString(wstring(&expandedValue[0], sz -1), _converter);
+ value = wstringToString(wstring(&expandedValue[0], sz -1), stringConverter);
}
setProperty(name, value);
}
@@ -427,7 +429,7 @@ Ice::PropertiesI::load(const std::string& file)
}
firstLine = false;
}
- parseLine(line, _converter);
+ parseLine(line, stringConverter);
}
}
}
@@ -455,18 +457,15 @@ Ice::PropertiesI::getUnusedProperties()
}
Ice::PropertiesI::PropertiesI(const PropertiesI* p) :
- _properties(p->_properties),
- _converter(p->_converter)
+ _properties(p->_properties)
{
}
-Ice::PropertiesI::PropertiesI(const StringConverterPtr& converter) :
- _converter(converter)
+Ice::PropertiesI::PropertiesI()
{
}
-Ice::PropertiesI::PropertiesI(StringSeq& args, const PropertiesPtr& defaults, const StringConverterPtr& converter) :
- _converter(converter)
+Ice::PropertiesI::PropertiesI(StringSeq& args, const PropertiesPtr& defaults)
{
if(defaults != 0)
{
@@ -728,7 +727,7 @@ Ice::PropertiesI::loadConfig()
}
if(ret > 0)
{
- value = wstringToString(wstring(&v[0], ret), _converter);
+ value = wstringToString(wstring(&v[0], ret), getProcessStringConverter());
}
else
{
diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h
index cbaaaa5e9a6..9b738c7927c 100644
--- a/cpp/src/Ice/PropertiesI.h
+++ b/cpp/src/Ice/PropertiesI.h
@@ -19,8 +19,7 @@
namespace Ice
{
-class PropertiesI : public Properties,
- public IceUtil::Mutex
+class PropertiesI : public Properties, public IceUtil::Mutex
{
public:
@@ -42,15 +41,11 @@ public:
std::set<std::string> getUnusedProperties();
PropertiesI(const PropertiesI*);
-
-private:
- PropertiesI(const StringConverterPtr&);
- PropertiesI(StringSeq&, const PropertiesPtr&, const StringConverterPtr&);
+ PropertiesI();
+ PropertiesI(StringSeq&, const PropertiesPtr&);
- friend ICE_API PropertiesPtr createProperties();
- friend ICE_API PropertiesPtr createProperties(StringSeq&, const PropertiesPtr&);
- friend ICE_API PropertiesPtr createProperties(int&, char*[], const PropertiesPtr&);
+private:
void parseLine(const std::string&, const StringConverterPtr&);
@@ -73,7 +68,6 @@ private:
bool used;
};
std::map<std::string, PropertyValue> _properties;
- const StringConverterPtr _converter;
};
}
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index e9241223c4a..afccbfe7ead 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -718,8 +718,7 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initializa
initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initData.properties->getProperty("Ice.StdErr").empty();
- _logger = ICE_MAKE_SHARED(LoggerI, initData.properties->getProperty("Ice.ProgramName"), "", convert,
- getProcessStringConverter());
+ _logger = ICE_MAKE_SHARED(LoggerI, initData.properties->getProperty("Ice.ProgramName"), "", convert);
setProcessLogger(_logger);
}
}
diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp
index f1025e83c16..3fa4383bf30 100755
--- a/cpp/src/IceSSL/Certificate.cpp
+++ b/cpp/src/IceSSL/Certificate.cpp
@@ -16,6 +16,7 @@
#include <IceSSL/RFC2253.h>
#include <Ice/Object.h>
#include <Ice/Base64.h>
+#include <Ice/StringConverter.h>
#if defined(ICE_USE_OPENSSL)
# include <openssl/x509v3.h>
diff --git a/cpp/src/IceSSL/SChannelEngine.cpp b/cpp/src/IceSSL/SChannelEngine.cpp
index 2c3e13db1ae..fd99646b27e 100644
--- a/cpp/src/IceSSL/SChannelEngine.cpp
+++ b/cpp/src/IceSSL/SChannelEngine.cpp
@@ -13,6 +13,7 @@
#include <Ice/LocalException.h>
#include <Ice/Logger.h>
#include <Ice/Communicator.h>
+#include <Ice/StringConverter.h>
#include <IceUtil/StringUtil.h>
#include <IceUtil/FileUtil.h>
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp
index d75d8da861a..5b592797842 100755
--- a/cpp/src/IceSSL/Util.cpp
+++ b/cpp/src/IceSSL/Util.cpp
@@ -20,6 +20,7 @@
#include <Ice/LocalException.h>
#include <Ice/Network.h>
#include <Ice/Object.h>
+#include <Ice/StringConverter.h>
#include <fstream>
#ifdef ICE_USE_OPENSSL
diff --git a/cpp/src/IceUtil/StringConverter.cpp b/cpp/src/IceUtil/StringConverter.cpp
index dc029626c4f..2613efd6fe9 100644
--- a/cpp/src/IceUtil/StringConverter.cpp
+++ b/cpp/src/IceUtil/StringConverter.cpp
@@ -334,7 +334,14 @@ WstringConverterPtr
IceUtil::getProcessWstringConverter()
{
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(processStringConverterMutex);
- return processWstringConverter;
+ if(processWstringConverter)
+ {
+ return processWstringConverter;
+ }
+ else
+ {
+ return getUnicodeWstringConverter();
+ }
}
void