chiark / gitweb /
utf8: minor simplifications
[elogind.git] / src / shared / utf8.h
index f56077438aa6970d7d6950b5452c5d9db97a85ff..59abee50ac08bc2ad26aed8fd90bea76869a606e 100644 (file)
 
 #include "macro.h"
 
+#define UTF8_REPLACEMENT_CHARACTER "\xef\xbf\xbd"
+
 const char *utf8_is_valid(const char *s) _pure_;
 char *ascii_is_valid(const char *s) _pure_;
 
-bool utf8_is_printable(const char* str, size_t length) _pure_;
+bool utf8_is_printable_newline(const char* str, size_t length, bool newline) _pure_;
+#define utf8_is_printable(str, length) utf8_is_printable_newline(str, length, true)
+
+char *utf8_escape_invalid(const char *s);
+char *utf8_escape_non_printable(const char *str);
 
 char *utf16_to_utf8(const void *s, size_t length);