summaryrefslogtreecommitdiff
path: root/src/utf.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-08-06 22:07:03 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-08-06 22:24:59 +0200
commitbe1dc86b5434e84a88ba2e62873d87c62f8880c0 (patch)
treeba73db824c64890d196f843b0b72e11b0185e7fc /src/utf.hh
parentd935594d14eb65b55db0d4e96d66a7404f2130d0 (diff)
Add utf module
Currently only has valid_utf8 and read_utf8
Diffstat (limited to 'src/utf.hh')
-rw-r--r--src/utf.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utf.hh b/src/utf.hh
new file mode 100644
index 0000000..7625b1b
--- /dev/null
+++ b/src/utf.hh
@@ -0,0 +1,14 @@
+// -*- mode: c++; c-basic-offset: 2; -*-
+
+#ifndef UTF_HH
+#define UTF_HH
+
+#include <string>
+
+char* read_utf8(char const* in, size_t max, uint32_t* out);
+
+bool valid_utf8(std::string const& str, size_t start = 0,
+ size_t len = std::string::npos);
+bool valid_utf8(char const* str, size_t len = std::string::npos);
+
+#endif // UTF_HH