diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-05 19:13:16 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-06 05:01:44 +0100 |
commit | b341d742dbb69ef3cc827f06e4aaddfe67b18d0f (patch) | |
tree | 1bb2eb6a85aaf9a22cbf86894d6b148c974add72 /libtests | |
parent | 3ef1b77304ec49ec2527d8cc3e17e1d0dd220720 (diff) | |
download | qpdf-b341d742dbb69ef3cc827f06e4aaddfe67b18d0f.tar.zst |
Add WinAnsi and MacRoman encoding
Diffstat (limited to 'libtests')
-rw-r--r-- | libtests/qtest/qutil/qutil.out | 2 | ||||
-rw-r--r-- | libtests/qutil.cc | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out index ca146c15..ca90d3d5 100644 --- a/libtests/qtest/qutil/qutil.out +++ b/libtests/qtest/qutil/qutil.out @@ -51,6 +51,8 @@ HAGOOGAMAGOOGLE: 0 ¿Does π have fingers? ?Does ? have fingers? *Does * have fingers? +<bf>Does * have fingers? +<c0>Does * have fingers? ---- whoami quack1 quack2 diff --git a/libtests/qutil.cc b/libtests/qutil.cc index 364eae1c..3779803c 100644 --- a/libtests/qutil.cc +++ b/libtests/qutil.cc @@ -229,6 +229,15 @@ void utf8_to_ascii_test() << std::endl << QUtil::utf8_to_ascii(input, '*') << std::endl; + std::string a = QUtil::utf8_to_win_ansi(input, '*'); + std::string b = QUtil::utf8_to_mac_roman(input, '*'); + std::cout + << "<" << QUtil::int_to_string_base( + static_cast<unsigned char>(a.at(0)), 16, 2) + << ">" << a.substr(1) << std::endl + << "<" << QUtil::int_to_string_base( + static_cast<unsigned char>(b.at(0)), 16, 2) + << ">" << b.substr(1) << std::endl; } void print_whoami(char const* str) |