*** empty log message ***
This commit is contained in:
parent
c2b496f472
commit
a29bf51908
|
@ -93,7 +93,7 @@ namespace
|
||||||
std::string ret;
|
std::string ret;
|
||||||
ret.resize(size);
|
ret.resize(size);
|
||||||
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
||||||
if (size == -1) return s;
|
if (size == wchar_t(-1)) return s;
|
||||||
ret.resize(size);
|
ret.resize(size);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,28 +55,6 @@ namespace
|
||||||
HLOCAL m_memory;
|
HLOCAL m_memory;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
std::wstring safe_convert(std::string const& s)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return libtorrent::utf8_wchar(s);
|
|
||||||
}
|
|
||||||
catch (std::exception)
|
|
||||||
{
|
|
||||||
std::wstring ret;
|
|
||||||
for (const char* i = &*s.begin(); i < &*s.end(); ++i)
|
|
||||||
{
|
|
||||||
wchar_t c;
|
|
||||||
c = '.';
|
|
||||||
std::mbtowc(&c, i, 1);
|
|
||||||
ret += c;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string utf8_native(std::string const& s)
|
std::string utf8_native(std::string const& s)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -88,6 +66,7 @@ namespace
|
||||||
std::string ret;
|
std::string ret;
|
||||||
ret.resize(size);
|
ret.resize(size);
|
||||||
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
||||||
|
if (ret == wchar_t(-1)) return s;
|
||||||
ret.resize(size);
|
ret.resize(size);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue