From http://www.jwz.org/xscreensaver/xscreensaver-5.33.tar.gz
[xscreensaver] / utils / utf8wc.h
index 563f77978555d2e7e2e684954a36d02496cbb2de..d91567c2c2e7746ebd2a5ec1ef3bab6a82a7d2b5 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2014 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2014-2015 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -33,4 +33,15 @@ extern char ** utf8_split (const char *string, int *length_ret);
  */
 extern char *utf8_to_latin1 (const char *string, Bool ascii_p);
 
+/* Converts a Unicode character to a multi-byte UTF8 sequence.
+   Returns the number of bytes written.
+ */
+extern int utf8_encode (unsigned long uc, char *out, long length);
+
+/* Parse the first UTF8 character at the front of the string.
+   Return the Unicode character, and the number of bytes read.
+ */
+extern long utf8_decode (const unsigned char *in, long length,
+                         unsigned long *unicode_ret);
+
 #endif /* __XSCREENSAVER_UTF8WC_H__ */