summaryrefslogtreecommitdiff
path: root/tests/gen-all-unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gen-all-unicode.c')
-rw-r--r--tests/gen-all-unicode.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/gen-all-unicode.c b/tests/gen-all-unicode.c
new file mode 100644
index 00000000..2ce37fd6
--- /dev/null
+++ b/tests/gen-all-unicode.c
@@ -0,0 +1,45 @@
+#include <glib.h>
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+ gunichar i;
+ gint j;
+
+ /* Output all characters in the BMP twice, once directly
+ * concatenated, once with spaces between them
+ */
+ for (j = 0 ; j < 2 ; j++)
+ {
+ for (i = 0; i < 65536; i++)
+ {
+ if (g_unichar_validate (i))
+ {
+ guchar buffer[7];
+ int len = g_unichar_to_utf8 (i, buffer);
+ buffer[len] = '\0';
+
+ if (j == 1)
+ fputs (" ", stdout);
+
+ fputs (buffer, stdout);
+
+ if (j == 0)
+ {
+ if (i % 40 == 0 && i != 0)
+ fputs ("\n", stdout);
+ }
+ else
+ {
+ if (i % 20 == 0 && i != 0)
+ fputs ("\n", stdout);
+ }
+ }
+ }
+ }
+ fputs ("\n", stdout);
+
+ return 0;
+}
+