diff --git a/extensions/bingtranslate/bingtranslate.cpp b/extensions/bingtranslate/bingtranslate.cpp index a1580c1..6135444 100644 --- a/extensions/bingtranslate/bingtranslate.cpp +++ b/extensions/bingtranslate/bingtranslate.cpp @@ -90,7 +90,7 @@ std::wstring Translate(std::wstring text, std::wstring& translateFrom, std::wstr for (int i = 0; utf8[i];) { wchar_t utf8char[3] = {}; - swprintf_s<3>(utf8char, L"%02X", (unsigned)utf8[i++]); + swprintf_s<3>(utf8char, L"%02X", (int)(unsigned char)utf8[i++]); text += L"%" + std::wstring(utf8char); } diff --git a/extensions/googletranslate/googletranslate.cpp b/extensions/googletranslate/googletranslate.cpp index 6791697..4ac05e5 100644 --- a/extensions/googletranslate/googletranslate.cpp +++ b/extensions/googletranslate/googletranslate.cpp @@ -106,7 +106,7 @@ std::wstring GetTranslationUri(std::wstring text, unsigned TKK) unsigned a = (unsigned)(_time64(NULL) / 3600), b = a; // <- the first part of TKK for (int i = 0; utf8[i];) { - a += (unsigned)utf8[i++]; + a += (unsigned char)utf8[i++]; a += a << 10; a ^= a >> 6; } @@ -121,7 +121,7 @@ std::wstring GetTranslationUri(std::wstring text, unsigned TKK) for (int i = 0; utf8[i];) { wchar_t utf8char[3] = {}; - swprintf_s<3>(utf8char, L"%02X", (unsigned)utf8[i++]); + swprintf_s<3>(utf8char, L"%02X", (int)(unsigned char)utf8[i++]); text += L"%" + std::wstring(utf8char); }