diff options
author | Marc Laukien <marc@zeroc.com> | 2001-11-12 16:25:32 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-11-12 16:25:32 +0000 |
commit | ce2e6402c7d59d7f89eaa14ba066ab575500e63c (patch) | |
tree | f6d38404ea229423e4e6c1823bcc6adff47b703e /cpp/src/IceUtil/Unicode.cpp | |
parent | fixes (diff) | |
download | ice-ce2e6402c7d59d7f89eaa14ba066ab575500e63c.tar.bz2 ice-ce2e6402c7d59d7f89eaa14ba066ab575500e63c.tar.xz ice-ce2e6402c7d59d7f89eaa14ba066ab575500e63c.zip |
Added missing file
Diffstat (limited to 'cpp/src/IceUtil/Unicode.cpp')
-rw-r--r-- | cpp/src/IceUtil/Unicode.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
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 <IceUtil/Unicode.h> + +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; +} |