mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
casting does not work like i thought it did
This commit is contained in:
parent
66d02a7bf0
commit
1d90787564
@ -90,7 +90,7 @@ std::wstring Translate(std::wstring text, std::wstring& translateFrom, std::wstr
|
|||||||
for (int i = 0; utf8[i];)
|
for (int i = 0; utf8[i];)
|
||||||
{
|
{
|
||||||
wchar_t utf8char[3] = {};
|
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);
|
text += L"%" + std::wstring(utf8char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
unsigned a = (unsigned)(_time64(NULL) / 3600), b = a; // <- the first part of TKK
|
||||||
for (int i = 0; utf8[i];)
|
for (int i = 0; utf8[i];)
|
||||||
{
|
{
|
||||||
a += (unsigned)utf8[i++];
|
a += (unsigned char)utf8[i++];
|
||||||
a += a << 10;
|
a += a << 10;
|
||||||
a ^= a >> 6;
|
a ^= a >> 6;
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ std::wstring GetTranslationUri(std::wstring text, unsigned TKK)
|
|||||||
for (int i = 0; utf8[i];)
|
for (int i = 0; utf8[i];)
|
||||||
{
|
{
|
||||||
wchar_t utf8char[3] = {};
|
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);
|
text += L"%" + std::wstring(utf8char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user