node-i3 icon indicating copy to clipboard operation
node-i3 copied to clipboard

measure payload length in utf-8

Open ceymard opened this issue 4 years ago • 0 comments

Encountered a problem when using workspaces that contain utf-8 characters in them. The problem arises from the fact that the payload length is measured in "rune" count, not byte count.

This PR makes use of Buffer.bytesLength in utf-8 (which is the most common encoding in the wild nowadays).

There may be other places where this might need to be applied but I haven't checked.

ceymard avatar Apr 11 '21 12:04 ceymard