fix repeat char bug

This commit is contained in:
UnknownObject
2025-07-08 15:00:22 +08:00
parent 521273638d
commit 1c65b30a64
3 changed files with 10 additions and 1 deletions
+4
View File
@@ -6861,11 +6861,15 @@ std::wstring uns::OCRCharset::GetString(const std::vector<int>& indexs)
}
if ((charset_ptr == nullptr))
return L"";
int last_index = 0;
std::wstring result;
for (const auto& index : indexs)
{
if (charset_ptr->find(index) == charset_ptr->end())
continue;
if (last_index == index)
continue;
last_index = index;
if (index == 0) //Ignore 0 (Invalidate Value)
continue;
result += (*charset_ptr)[index];