fix for non unicode locales
This commit is contained in:
@@ -646,8 +646,8 @@ char * ToString(const wchar_t *ws)
|
||||
string s;
|
||||
for (int i = 0; i < wcslen(ws); i++)
|
||||
{
|
||||
char *c = new char[MB_CUR_MAX]();
|
||||
wctomb(c, ws[i]);
|
||||
char *c = new char[MB_CUR_MAX+1]();
|
||||
if (wctomb(c, ws[i]) > 0)
|
||||
s += c;
|
||||
delete [] c;
|
||||
}
|
||||
@@ -667,8 +667,8 @@ string ToString(const wstring &ws)
|
||||
string s;
|
||||
for (wstring::const_iterator it = ws.begin(); it != ws.end(); it++)
|
||||
{
|
||||
char *c = new char[MB_CUR_MAX]();
|
||||
wctomb(c, *it);
|
||||
char *c = new char[MB_CUR_MAX+1]();
|
||||
if (wctomb(c, *it) > 0)
|
||||
s += c;
|
||||
delete [] c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user