From 463037773177eb616f2dfd9a58f039b3eebd192c Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 14 Jan 2019 08:39:13 -0500 Subject: Add status-reporting transcoders to QUtil --- include/qpdf/QUtil.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index d9b0783e..5fe8e97c 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -178,6 +178,22 @@ namespace QUtil std::string utf8_to_pdf_doc( std::string const& utf8, char unknown_char = '?'); + // These versions return true if the conversion was successful and + // false if any unrepresentable characters were found and had to + // be substituted with the unknown character. + QPDF_DLL + bool utf8_to_ascii( + std::string const& utf8, std::string& ascii, char unknown_char = '?'); + QPDF_DLL + bool utf8_to_win_ansi( + std::string const& utf8, std::string& win, char unknown_char = '?'); + QPDF_DLL + bool utf8_to_mac_roman( + std::string const& utf8, std::string& mac, char unknown_char = '?'); + QPDF_DLL + bool utf8_to_pdf_doc( + std::string const& utf8, std::string& pdfdoc, char unknown_char = '?'); + // Convert a UTF-16 big-endian encoded string to UTF-8. // Unrepresentable code points are converted to U+FFFD. QPDF_DLL -- cgit v1.2.3-54-g00ecf