santaclose / ImGuiColorTextEdit

Colorizing text editor for ImGui
MIT License
67 stars 18 forks source link

Broken UTF-8 causes crash #10

Open disarray2077 opened 1 year ago

disarray2077 commented 1 year ago

This widget seems to assume UTF-8 bytes are always correct, so when it encounters a broken UTF-8 sequence it crashes on this line (if the byte is on the end of the line): https://github.com/santaclose/ImGuiColorTextEdit/blob/76d9ff0d22e89c8e4e93d0cf5e40f8af3def19a8/TextEditor.cpp#L1234C3-L1234C3

santaclose commented 1 year ago

are you loading a file? can you provide the file if so?

disarray2077 commented 1 year ago

@santaclose here it is: crash.txt