From ce2e6402c7d59d7f89eaa14ba066ab575500e63c Mon Sep 17 00:00:00 2001 From: Marc Laukien Date: Mon, 12 Nov 2001 16:25:32 +0000 Subject: Added missing file --- cpp/src/IceUtil/Unicode.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 cpp/src/IceUtil/Unicode.cpp (limited to 'cpp/src/IceUtil/Unicode.cpp') diff --git a/cpp/src/IceUtil/Unicode.cpp b/cpp/src/IceUtil/Unicode.cpp new file mode 100644 index 00000000000..ba298e3b770 --- /dev/null +++ b/cpp/src/IceUtil/Unicode.cpp @@ -0,0 +1,33 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include + +using namespace std; + +string +IceUtil::wstringToString(const wstring& str) +{ + char* s = new char[str.size() + 1]; + wcstombs(s, str.c_str(), str.size() + 1); + string result(s); + delete [] s; + return result; +} + +wstring +IceUtil::stringToWstring(const string& str) +{ + wchar_t* s = new wchar_t[str.size() + 1]; + mbstowcs(s, str.c_str(), str.size() + 1); + wstring result(s); + delete [] s; + return result; +} -- cgit v1.2.3