rust-x-bindings / xkbcommon-rs

bindings and safe wrappers for libxkbcommon
MIT License
20 stars 24 forks source link

xkb::key_get_utf8 appends a null byte to the returned String. #50

Closed oshaboy closed 4 months ago

oshaboy commented 5 months ago

This doesn't happen with the other "to_utf8" functions.

oshaboy commented 5 months ago

I found the bug and fixed it in #51. Turns out xkb_keysym_to_utf8 returns the length including the null terminator.

oshaboy commented 5 months ago

BTW you might want to have it return an Option\<String> or even a Result as opposed to a String. I know it's a breaking API change so I didn't do it.

rtbo commented 4 months ago

closed by #51 #53