fixed duplicate space
This commit is contained in:
parent
4be0798660
commit
de9a3ede6d
|
@ -251,7 +251,7 @@ namespace GakumasLocal::Local {
|
|||
}
|
||||
|
||||
bool GetSplitTagsTranslation(const std::string& origText, std::string* newText, std::vector<std::string>& unTransResultRet) {
|
||||
if (!origText.contains(L'<')) return false;
|
||||
if (!origText.contains('<')) return false;
|
||||
const auto splitResult = SplitByTags(origText);
|
||||
if (splitResult.empty()) return false;
|
||||
|
||||
|
@ -291,10 +291,18 @@ namespace GakumasLocal::Local {
|
|||
|
||||
std::u16string currentWaitingReplaceText;
|
||||
|
||||
#ifdef GKMS_WINDOWS
|
||||
#define checkCurrentWaitingReplaceTextAndClear() \
|
||||
if (!currentWaitingReplaceText.empty()) { \
|
||||
auto trimmed = trim(Misc::ToUTF8(currentWaitingReplaceText)); \
|
||||
waitingReplaceTexts.push_back(trimmed); \
|
||||
currentWaitingReplaceText.clear(); }
|
||||
#else
|
||||
#define checkCurrentWaitingReplaceTextAndClear() \
|
||||
if (!currentWaitingReplaceText.empty()) { \
|
||||
waitingReplaceTexts.push_back(Misc::ToUTF8(currentWaitingReplaceText)); \
|
||||
currentWaitingReplaceText.clear(); }
|
||||
#endif
|
||||
|
||||
for (char16_t currChar : origText) {
|
||||
if (currChar == u'<') {
|
||||
|
|
|
@ -14,6 +14,24 @@
|
|||
|
||||
|
||||
namespace GakumasLocal::Misc {
|
||||
|
||||
#ifdef GKMS_WINDOWS
|
||||
std::string ToUTF8(const std::wstring_view& str) {
|
||||
return utility::conversions::to_utf8string(str.data());
|
||||
}
|
||||
|
||||
std::u16string ToUTF16(const std::string_view& str) {
|
||||
std::string input(str);
|
||||
std::wstring wstr = utility::conversions::utf8_to_utf16(input);
|
||||
return std::u16string(wstr.begin(), wstr.end());
|
||||
}
|
||||
|
||||
std::string ToUTF8(const std::u16string_view& str) {
|
||||
std::u16string u16(str);
|
||||
std::wstring wstr(u16.begin(), u16.end());
|
||||
return utility::conversions::utf16_to_utf8(wstr);
|
||||
}
|
||||
#else
|
||||
std::u16string ToUTF16(const std::string_view& str) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> utf16conv;
|
||||
return utf16conv.from_bytes(str.data(), str.data() + str.size());
|
||||
|
@ -23,11 +41,6 @@ namespace GakumasLocal::Misc {
|
|||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> utf16conv;
|
||||
return utf16conv.to_bytes(str.data(), str.data() + str.size());
|
||||
}
|
||||
|
||||
#ifdef GKMS_WINDOWS
|
||||
std::string ToUTF8(const std::wstring_view& str) {
|
||||
return utility::conversions::to_utf8string(str.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef GKMS_WINDOWS
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace GkmsResourceUpdate {
|
|||
}
|
||||
|
||||
void CheckUpdateFromAPI(bool isManual) {
|
||||
std::thread([&isManual]() {
|
||||
std::thread([isManual]() {
|
||||
try {
|
||||
if (!g_useAPIAssets) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue