blob: ba298e3b77063657bb8962783badca8b992808ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}
|