aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/unicode-utils.h
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-31 18:16:16 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-31 18:16:16 +0000
commit418699b85d0bbe5497ca0570f3c15ae9274460ed (patch)
tree1f90d8bfccded286555efd67500f2c0e0bb062fe /wsutil/unicode-utils.h
parent80d50191a3f235e9667a838873c16d547201ad46 (diff)
Add utf_8to16_snprintf() which creates a UTF16 string according to the given format string. The format string + arguments are expected to be in UTF-8 format. This change effectively removes the only place where we use PRIu64.
svn path=/trunk/; revision=29635
Diffstat (limited to 'wsutil/unicode-utils.h')
-rw-r--r--wsutil/unicode-utils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/wsutil/unicode-utils.h b/wsutil/unicode-utils.h
index 2a08be71af..f3c423ffd8 100644
--- a/wsutil/unicode-utils.h
+++ b/wsutil/unicode-utils.h
@@ -27,6 +27,15 @@
#ifdef _WIN32
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <glib.h>
+#include <windows.h>
+#include <tchar.h>
+#include <wchar.h>
+
/**
* @file Unicode convenience routines.
*/
@@ -40,6 +49,14 @@
*/
wchar_t * utf_8to16(const char *utf8str);
+/** Create a UTF-16 string (in place) according to the format string.
+ *
+ * @param utf16buf The buffer to return the UTF-16 string in.
+ * @param utf16buf_len The size of the 'utf16buf' parameter
+ * @param fmt A standard g_printf() format string
+ */
+void utf_8to16_snprintf(TCHAR *utf16buf, gint utf16buf_len, const gchar* fmt, ...);
+
/** Given a UTF-16 string, convert it to UTF-8. This is meant to be used
* to convert between GTK+ 2.x (UTF-8) to Windows (UTF-16).
*