summaryrefslogtreecommitdiff
path: root/include/utilstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/utilstr.h')
-rw-r--r--include/utilstr.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/utilstr.h b/include/utilstr.h
index 1864edb..a93299f 100644
--- a/include/utilstr.h
+++ b/include/utilstr.h
@@ -1,7 +1,7 @@
/******************************************************************************
* utilstr.h - prototypes for string utility functions
*
- * $Id: utilstr.h 2391 2009-05-08 02:02:16Z chrislit $
+ * $Id: utilstr.h 2446 2009-08-24 00:43:27Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -24,6 +24,7 @@
#include <defs.h>
#include <sysdata.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
@@ -56,5 +57,19 @@ extern const unsigned char SW_toupper_array[256];
__u32 getUniCharFromUTF8(const unsigned char **buf);
+/******************************************************************************
+ * assureValidUTF8 - iterates the supplied UTF-8 buffer and checks for validity
+ * replacing invalid bytes if necessary and returning a
+ * verified UTF8 buffer, leaving the original input
+ * unchanged.
+ *
+ * ENT: buf - a utf8 buffer
+ *
+ * RET: input buffer validated and any problems fixed by substituting a
+ * replacement character for bytes not valid.
+ */
+SWBuf assureValidUTF8(const char *buf);
+
+
SWORD_NAMESPACE_END
#endif