simonsteele / pn

Programmer's Notepad
372 stars 116 forks source link

Selected UTF-8 characters show invalid number of characters #188

Open nikhilmahale opened 5 years ago

nikhilmahale commented 5 years ago

"characters selected" feature in status bar shows number of characters depending on bytes and not actual characters. Lets consider an UTF-8 encoded Russian string Иосиф Сталин (Joseph Stalin). If we select this string in pn then it shows "23 characters selected". Whereas these are only 12 characters(11 Russian + 1 space) with size 23 bytes. This would most probably happen for other encoding also.