Open vain opened 5 months ago
The pasting code iterates over the bytes we read from wl-paste/xclip and that breaks when you try to paste multibyte sequences:
wl-paste
xclip
https://github.com/Cloudef/bemenu/blob/5bc8a6caaa74f2255fbf4ef8185be50c6e3e6fbe/lib/menu.c#L1199-L1203
As an example, select this character: ö and try to paste it.
ö
The code calls bm_unicode_insert(), which expects unicode codepoints, not raw bytes. We have to UTF-8-decode the whole string first.
bm_unicode_insert()
The pasting code iterates over the bytes we read from
wl-paste
/xclip
and that breaks when you try to paste multibyte sequences:https://github.com/Cloudef/bemenu/blob/5bc8a6caaa74f2255fbf4ef8185be50c6e3e6fbe/lib/menu.c#L1199-L1203
As an example, select this character:
ö
and try to paste it.The code calls
bm_unicode_insert()
, which expects unicode codepoints, not raw bytes. We have to UTF-8-decode the whole string first.