Strings are UTF-8
The documentation of the wire protocol does not talk in detail about the contents of strings except that the last byte is 0. It does not require that strings contain valid UTF-8.
Some protocols go out of their way to require that some (but not all) strings are UTF-8:
- core
- xdg-shell
- input-method-v2
- tablet-unstable-v2
- text-input-unstable-v3
- xdg-output-unstable-v1
In my implementation I require all strings to be UTF-8. I believe that it is the same in https://github.com/smithay/wayland-rs.
Maybe it is time to codify that all strings are valid UTF-8. Any new protocols that want to support non-UTF-8 strings can use the array type.