diff options
author | Sebastian Geerken <devnull@localhost> | 2012-12-13 22:43:15 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2012-12-13 22:43:15 +0100 |
commit | f5380a56b1a6b83fea9b1c97140d4b1c8fe4ba49 (patch) | |
tree | 93a792dc006a046b4187acf95c6c8b79df97a920 /test/unicode_test.cc | |
parent | 1471c240d49b60ef081f50230f2eee8852793716 (diff) |
New function nextUtf8Char; usage in dw::Hyphenator and (partly) dw::Textblock.
Diffstat (limited to 'test/unicode_test.cc')
-rw-r--r-- | test/unicode_test.cc | 15 |
1 files changed, 15 insertions, 0 deletions
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 <string.h> +#include <stdio.h> +#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; +} |