summaryrefslogtreecommitdiff
path: root/src/common/utf8.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-12 22:12:02 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-12 22:12:02 +0300
commit94c5e361fbb229b0cd6853e2102a7d95f1f358b3 (patch)
tree3c0f11af9dcb84dac8067a31a6979acd6dd56fbf /src/common/utf8.h
parent08dc9047098d6d96791024ac7d8f5837633673ef (diff)
better public interface and doxygen
Diffstat (limited to 'src/common/utf8.h')
-rw-r--r--src/common/utf8.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/utf8.h b/src/common/utf8.h
new file mode 100644
index 0000000..f31c99d
--- /dev/null
+++ b/src/common/utf8.h
@@ -0,0 +1,14 @@
+#ifndef YASL_COMMON_UTF8_H
+#define YASL_COMMON_UTF8_H
+
+#include <stdbool.h>
+#include <stddef.h>
+
+bool yasl_utf8_validate(const char *str, size_t len);
+char *yasl_utf8_sanitize_dup(const char *str);
+/* Owned conversions for X11 STRING interoperability. to_latin1 rejects text
+ * outside Latin-1; byte lengths exclude the allocated NUL terminator. */
+char *yasl_utf8_from_latin1(const char *str, size_t len, size_t *out_len);
+char *yasl_utf8_to_latin1(const char *str, size_t *out_len);
+
+#endif