aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'libtests')
-rw-r--r--libtests/qtest/qutil/qutil.out4
-rw-r--r--libtests/qutil.cc13
2 files changed, 17 insertions, 0 deletions
diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out
index 8223bf5b..f47301e4 100644
--- a/libtests/qtest/qutil/qutil.out
+++ b/libtests/qtest/qutil/qutil.out
@@ -47,6 +47,10 @@ HAGOOGAMAGOOGLE: 0
0xdead -> ff fd
0x7fffffff -> ff fd
0x80000000 -> ff fd
+---- utf8_to_ascii
+Does π have fingers?
+Does ? have fingers?
+Does * have fingers?
---- whoami
quack1
quack2
diff --git a/libtests/qutil.cc b/libtests/qutil.cc
index 025f4e43..de51da58 100644
--- a/libtests/qutil.cc
+++ b/libtests/qutil.cc
@@ -220,6 +220,17 @@ void to_utf16_test()
print_utf16(0x80000000UL);
}
+void utf8_to_ascii_test()
+{
+ char const* input = "Does \317\200 have fingers?";
+ std::cout << input
+ << std::endl
+ << QUtil::utf8_to_ascii(input)
+ << std::endl
+ << QUtil::utf8_to_ascii(input, '*')
+ << std::endl;
+}
+
void print_whoami(char const* str)
{
PointerHolder<char> dup(true, QUtil::copy_string(str));
@@ -328,6 +339,8 @@ int main(int argc, char* argv[])
to_utf8_test();
std::cout << "---- utf16" << std::endl;
to_utf16_test();
+ std::cout << "---- utf8_to_ascii" << std::endl;
+ utf8_to_ascii_test();
std::cout << "---- whoami" << std::endl;
get_whoami_test();
std::cout << "---- file" << std::endl;