From c1599cb19601443c48c45c5ad8d1b0d40a6238bc Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Sun, 24 Apr 2016 22:18:56 +0200 Subject: DLS: add DL Plus support - adds support for Dynamic Label Plus to mot-encoder through a new parameter block which prepends the DLS text within the regarding file - adds an option to add DL Plus data to the VLC input ICY text of dabplus-enc --- src/utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 0168a23..24da427 100644 --- a/src/utils.c +++ b/src/utils.c @@ -28,3 +28,13 @@ const char* level(int channel, int peak) return text[index][channel]; } +size_t strlen_utf8(const char *s) { + size_t result = 0; + + // ignore continuation bytes - only count single/leading bytes + while (*s) + if ((*s++ & 0xC0) != 0x80) + result++; + + return result; +} -- cgit v1.2.3