OS: Windows 10
Version: 0.3.3
Commit/Build: 72b6160
When I try to rename Air Powered Vertical Coaster(์์ด ํ์๋ ๋ฒํฐ์ปฌ ์ฝ์คํฐ) in CJK language, it crashes.
Maybe @AaronVanGeffen can reproduce it.
It is possible if I (1) change language into English, (2) rename it (3) and re-change into Korean again
Steps to reproduce:
์์ด ํ์๋ ๋ฒํฐ์ปฌ ์ฝ์คํฐ 1 in Korean)Overflow occurs inside of gfx_wrap_string (which called by CalculateWindowHeight)
https://github.com/OpenRCT2/OpenRCT2/blob/2c3c014f14bf71bb164fb39b3479770af92d5129/src/openrct2/drawing/Drawing.String.cpp#L191
It doesn't crash for me, it freezes.
Also, my debugger points to Drawing.String.cpp:843 instead of 191.
The problem might be that it tries to truncate the string to 32 bytes in TextInput.cpp:
void SetText(std::string_view text, size_t maxLength)
{
_buffer = text;
_buffer.resize(maxLength);
_maxInputLength = maxLength;
gTextInput = context_start_text_input(_buffer.data(), maxLength);
}
But by doing so, it lands in the middle of a UTF-8 sequence. (EC 8A A4 gets truncated to EC 8A).