2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-27 20:49:06 +00:00
qpdf/qpdf/test_pdf_unicode.cc
Jay Berkenbilt 820a3f04fd Remove "lt-" workarounds
The executables that libtool built invoked the underlying binary with
an "lt-" prefix. The code contained numerous workarounds for testing,
which can now be removed.
2022-03-18 19:53:18 -04:00

42 lines
891 B
C++

#include <qpdf/QUtil.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <iostream>
#include <stdlib.h>
#include <string.h>
static char const* whoami = 0;
void usage()
{
std::cerr << "Usage: " << whoami << " infile" << std::endl;
exit(2);
}
int main(int argc, char* argv[])
{
if ((whoami = strrchr(argv[0], '/')) == NULL)
{
whoami = argv[0];
}
else
{
++whoami;
}
if (argc != 2)
{
usage();
}
char const* infilename = argv[1];
std::list<std::string> lines =
QUtil::read_lines_from_file(infilename);
for (std::list<std::string>::iterator iter = lines.begin();
iter != lines.end(); ++iter)
{
QPDFObjectHandle str = QPDFObjectHandle::newUnicodeString(*iter);
std::cout << str.getUTF8Value() << " // "
<< str.unparseBinary() << std::endl;
}
return 0;
}