Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matanki-saito committed Aug 24, 2024
1 parent ea1c1d4 commit a0fedb2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions Plugin64/escape_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,8 @@ ParadoxTextObject* utf8ToEscapedStr2(ParadoxTextObject* from) {
return tmpZV2;
}

ParadoxTextObject* tmpParadoxTextObject2 = NULL;
char* escapedStrToUtf8(ParadoxTextObject* from) {

if (tmpParadoxTextObject2 != NULL) {
if (tmpParadoxTextObject2->len > 0x10) {
free(tmpParadoxTextObject2->t.p);
}
delete tmpParadoxTextObject2;
}
tmpParadoxTextObject2 = new ParadoxTextObject();

std::wstring* buffer = new std::wstring();
std::string* dest = new std::string();
std::string src = from->getString();
Expand All @@ -460,12 +451,12 @@ char* escapedStrToUtf8(ParadoxTextObject* from) {
// wide char (ucs2) -> UTF-8
convertWideTextToUtf8(buffer, dest);

tmpParadoxTextObject2->setString(dest);
from->setString(dest);

delete buffer;
delete dest;

return (char*)tmpParadoxTextObject2;
return (char*)from;
}

char* utf8ToEscapedStr3buffer = NULL;
Expand Down

0 comments on commit a0fedb2

Please sign in to comment.