aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QUtil.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-14 14:39:13 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-17 17:43:56 +0100
commit463037773177eb616f2dfd9a58f039b3eebd192c (patch)
tree7ed4b8d93fb86f5e6ef9c815d4edd7b3cd8f9fd1 /include/qpdf/QUtil.hh
parent429ffcf397287cc94d6d4ec466c7576b9d6747a5 (diff)
downloadqpdf-463037773177eb616f2dfd9a58f039b3eebd192c.tar.zst
Add status-reporting transcoders to QUtil
Diffstat (limited to 'include/qpdf/QUtil.hh')
-rw-r--r--include/qpdf/QUtil.hh16
1 files changed, 16 insertions, 0 deletions
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