about summary refs log tree commit diff
path: root/src/base/system.h
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-01 00:55:16 +0200
committeroy <Tom_Adams@web.de>2010-10-01 00:55:16 +0200
commit67e9f03f23a454f273aeb6f83e338c057c3efb93 (patch)
treef6ec82e186ea23861b2eb2c3576e7b38c19dec52 /src/base/system.h
parent2f388139c1e46d8cde32bd446b880e4225b06b35 (diff)
downloadzcatch-67e9f03f23a454f273aeb6f83e338c057c3efb93.tar.gz
zcatch-67e9f03f23a454f273aeb6f83e338c057c3efb93.zip
when setting a config string variable check if it's a utf8 string and encode it if the check fails. Closes #10
Diffstat (limited to 'src/base/system.h')
-rw-r--r--src/base/system.h16
1 files changed, 16 insertions, 0 deletions
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