ssilver2007 / LCD_1602_RUS_ALL

Библиотека поддержки кириллицы для дисплеев на базе контроллера HD44780 без встроенной кириллицы. Подключение дисплея как напрямую (10-контактное), так и по интерфейсу I2C.
GNU General Public License v3.0
61 stars 11 forks source link

Print "broken" unicode characters #11

Open Voha888 opened 5 months ago

Voha888 commented 5 months ago

If I attempt to trim a string in Arduino using the .remove() or .substring() methods, these methods employ byte-based trimming. Consequently, Unicode characters become split into two parts. When your library, for instance, receives character 208 (the first part of a Unicode Cyrillic letter), it expects the subsequent character to represent the Cyrillic letter's code, without considering that this might indicate the end of the string. This could potentially cause the library to exceed the bounds of the string array, leading to a reboot of my ESP32 controller. I will try to address this issue and submit a pull request. However, you might have a better understanding of your library and could advise on where an additional length check could be implemented. Thank you

Voha888 commented 5 months ago

My pull request to fix this issue https://github.com/ssilver2007/LCD_1602_RUS_ALL/pull/12