From a3d22dbe972770f84ae71f7080fb7bc676c2ba7a Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sat, 11 Nov 2023 16:55:41 -0500 Subject: xdg-toplevel: check that title provided actually is UTF-8 While the xdg-shell protocol requires this, it does not yet have a dedicated error code for invalid titles; this commit makes wlroots send a generic error instead. --- include/util/utf8.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 include/util/utf8.h (limited to 'include') diff --git a/include/util/utf8.h b/include/util/utf8.h new file mode 100644 index 00000000..4d5172c7 --- /dev/null +++ b/include/util/utf8.h @@ -0,0 +1,11 @@ +#ifndef UTIL_UTF8_H +#define UTIL_UTF8_H + +#include + +/** + * Return true if and only if the string is a valid UTF-8 sequence. + */ +bool is_utf8(const char *string); + +#endif -- cgit v1.2.3