From 67e9f03f23a454f273aeb6f83e338c057c3efb93 Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 1 Oct 2010 00:55:16 +0200 Subject: when setting a config string variable check if it's a utf8 string and encode it if the check fails. Closes #10 --- src/base/system.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/base/system.h') diff --git a/src/base/system.h b/src/base/system.h index f71a03ec..62fe02e9 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -1147,6 +1147,22 @@ int str_utf8_decode(const char **ptr); */ int str_utf8_encode(char *ptr, int chr); +/* + Function: str_utf8_check + Checks if a strings contains just valid utf8 characters. + + Parameters: + str - Pointer to a possible utf8 string. + + Returns: + 0 - invalid characters found. + 1 - only valid characters found. + + Remarks: + - The string is treated as zero-terminated utf8 string. +*/ +int str_utf8_check(const char *str); + #ifdef __cplusplus } #endif -- cgit 1.4.1