#include <glib.h>
#include <stdio.h>

int main() {
	guint i, len;
	GError *err = NULL;
	gchar *uni, *conv, str[7];
	gunichar c;

	for (i = 200; i < 512; i++) {
		uni = g_strdup_printf("U+%04X", i);

		sscanf(uni, "U+%06X", &c);
		len = g_unichar_to_utf8(c, str);
		str[len] = '\0';
		if ((conv = g_locale_from_utf8(str, -1, NULL, NULL, &err)) != NULL)
			printf("%s: '%s' -> '%s'\n", uni, str, conv);
		else {
			printf("%s: '%s' -> '%s'\n", uni, str, err->message);
			g_error_free(err);
			err = NULL;
		}

		g_free(uni);
		g_free(conv);
	}
	return 0;
}
