aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/qutil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtests/qutil.cc')
-rw-r--r--libtests/qutil.cc13
1 files changed, 13 insertions, 0 deletions
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;