1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

handle RCT2 language encoding properly

This commit is contained in:
Ted John
2016-07-04 19:03:30 +01:00
parent 2824224710
commit 793e83779f
3 changed files with 17 additions and 7 deletions

View File

@@ -56,17 +56,17 @@ void StringTable::Read(IReadObjectContext * context, IStream * stream, uint8 id)
entry.Id = id;
entry.LanguageId = languageId;
char * win1252 = stream->ReadString();
if (StringIsBlank(win1252))
char * stringAsWin1252 = stream->ReadString();
utf8 * stringAsUtf8 = rct2_language_string_to_utf8(stringAsWin1252, languageId);
Memory::Free(stringAsWin1252);
if (StringIsBlank(stringAsUtf8))
{
entry.LanguageId = RCT2_LANGUAGE_ID_BLANK;
}
String::Trim(stringAsUtf8);
entry.Text = win1252_to_utf8_alloc(win1252);
Memory::Free(win1252);
String::Trim(entry.Text);
entry.Text = stringAsUtf8;
_strings.push_back(entry);
}
}