diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-09-13 07:20:50 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-09-13 07:20:50 +0000 |
| commit | 33f3818520bd5f7a063f64442c54d41625332aeb (patch) | |
| tree | 33d21207b1f2473800358ec0a594942b965034db /misc.c | |
| parent | xsnprintf: various improvements related to xvsnprintf() and xsnprintf() (diff) | |
| parent | changelog: remove escape sequences we've reverted (diff) | |
Merge branch 'toplevel-icon'
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -42,3 +42,10 @@ timespec_sub(const struct timespec *a, const struct timespec *b, res->tv_nsec += one_sec_in_ns; } } + +bool +is_valid_utf8(const char *value) +{ + return value != NULL && + mbsntoc32(NULL, value, strlen(value), 0) != (size_t)-1; +} |
