Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
util_utf8.h
Go to the documentation of this file.
1/*
2 * Copyright The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
13
14#ifndef ZEPHYR_INCLUDE_SYS_UTIL_UTF8_H_
15#define ZEPHYR_INCLUDE_SYS_UTIL_UTF8_H_
16
17#include <stdbool.h>
18#include <stddef.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28
54char *utf8_trunc(char *utf8_str);
55
70char *utf8_lcpy(char *dst, const char *src, size_t n);
71
84int utf8_count_chars(const char *s);
85
113bool utf8_is_valid(const char *s, size_t len);
114
115#ifdef __cplusplus
116}
117#endif
118
122
123#endif /* ZEPHYR_INCLUDE_SYS_UTIL_UTF8_H_ */
char * utf8_trunc(char *utf8_str)
Properly truncate a NULL-terminated UTF-8 string.
char * utf8_lcpy(char *dst, const char *src, size_t n)
Copies a UTF-8 encoded string from src to dst.
bool utf8_is_valid(const char *s, size_t len)
Check that a string is well-formed UTF-8.
int utf8_count_chars(const char *s)
Counts the characters in a UTF-8 encoded string s.