Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
155 stars 50 forks source link

Multi-byte UTF-8 characters not handled correctly in EEPROM #247

Closed DjingisKan closed 10 months ago

DjingisKan commented 1 year ago

If a multi-byte UTF-8 character appears in the EEPROM code, the EEPROM will be loaded (in the UI and via getEEPROM()) with characters missing at the end.

The reason is likely this line: https://github.com/Panakotta00/FicsIt-Networks/blob/6e5280c81d444c7a59224e03a8797cc5c3659ee5/Source/FicsItNetworks/FicsItKernel/Processor/Lua/LuaComputerAPI.cpp#L98

The number of characters from the Unicode string is used to initialize the UTF-8 string and these to not match, if multi-byte characters are present.

Initial report by Sorontik: https://discord.com/channels/735877487808086088/744188242575884348/1051225542747238410