aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/qutil.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-04 02:03:30 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-04 05:18:13 +0100
commit02281632ccbba3ef00a6968bfd697f4be836d0dd (patch)
treebac13076f812b968257140d9123f664905a5da8e /libtests/qutil.cc
parentb55567a0fa6708500cd0905f7a26a28d70979001 (diff)
downloadqpdf-02281632ccbba3ef00a6968bfd697f4be836d0dd.tar.zst
Add QUtil::utf8_to_ascii
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;