зеркало из https://github.com/nextcloud/desktop.git
Windows Integration: Don't use size_t in StringUtil, it's unsigned
This commit is contained in:
Родитель
332601ed26
Коммит
027328d3a6
|
@ -17,19 +17,19 @@
|
|||
|
||||
#include "StringUtil.h"
|
||||
|
||||
std::string StringUtil::toUtf8(const wchar_t *utf16, size_t len)
|
||||
std::string StringUtil::toUtf8(const wchar_t *utf16, int len)
|
||||
{
|
||||
if (len < 0) {
|
||||
len = wcslen(utf16);
|
||||
len = (int) wcslen(utf16);
|
||||
}
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> > converter;
|
||||
return converter.to_bytes(utf16, utf16+len);
|
||||
}
|
||||
|
||||
std::wstring StringUtil::toUtf16(const char *utf8, size_t len)
|
||||
std::wstring StringUtil::toUtf16(const char *utf8, int len)
|
||||
{
|
||||
if (len < 0) {
|
||||
len = strlen(utf8);
|
||||
len = (int) strlen(utf8);
|
||||
}
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> > converter;
|
||||
return converter.from_bytes(utf8, utf8+len);
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
class __declspec(dllexport) StringUtil {
|
||||
public:
|
||||
static std::string toUtf8(const wchar_t* utf16, size_t len = -1);
|
||||
static std::wstring toUtf16(const char* utf8, size_t len = -1);
|
||||
static std::string toUtf8(const wchar_t* utf16, int len = -1);
|
||||
static std::wstring toUtf16(const char* utf8, int len = -1);
|
||||
|
||||
template<class T>
|
||||
static bool begins_with(const T& input, const T& match)
|
||||
|
|
Загрузка…
Ссылка в новой задаче