summaryrefslogtreecommitdiff
path: root/src/common/utf8.h
blob: f31c99db469c18cd7879f7f3b7038ad9d92d0eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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