forked from premiere/premiere-libtorrent
*** empty log message ***
This commit is contained in:
parent
c2b496f472
commit
a29bf51908
|
@ -93,7 +93,7 @@ namespace
|
|||
std::string ret;
|
||||
ret.resize(size);
|
||||
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
||||
if (size == -1) return s;
|
||||
if (size == wchar_t(-1)) return s;
|
||||
ret.resize(size);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -55,28 +55,6 @@ namespace
|
|||
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)
|
||||
{
|
||||
try
|
||||
|
@ -88,6 +66,7 @@ namespace
|
|||
std::string ret;
|
||||
ret.resize(size);
|
||||
size = wcstombs(&ret[0], ws.c_str(), size + 1);
|
||||
if (ret == wchar_t(-1)) return s;
|
||||
ret.resize(size);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue