From f5380a56b1a6b83fea9b1c97140d4b1c8fe4ba49 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Thu, 13 Dec 2012 22:43:15 +0100 Subject: New function nextUtf8Char; usage in dw::Hyphenator and (partly) dw::Textblock. --- test/unicode_test.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/unicode_test.cc (limited to 'test/unicode_test.cc') diff --git a/test/unicode_test.cc b/test/unicode_test.cc new file mode 100644 index 00000000..3cd43710 --- /dev/null +++ b/test/unicode_test.cc @@ -0,0 +1,15 @@ +#include +#include +#include "../lout/unicode.hh" + +using namespace lout::unicode; + +int main (int argc, char *argv[]) +{ + const char *t = "abcäöüабв−‐"; + + for (const char *s = t; s; s = nextUtf8Char (s, strlen (s))) + printf ("%3d -> U+%04x ('%s')\n", (int)(s - t), decodeUtf8(s), s); + + return 0; +} -- cgit v1.2.3