diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-04 02:03:30 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-04 05:18:13 +0100 |
commit | 02281632ccbba3ef00a6968bfd697f4be836d0dd (patch) | |
tree | bac13076f812b968257140d9123f664905a5da8e /include | |
parent | b55567a0fa6708500cd0905f7a26a28d70979001 (diff) | |
download | qpdf-02281632ccbba3ef00a6968bfd697f4be836d0dd.tar.zst |
Add QUtil::utf8_to_ascii
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QUtil.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index 96c0530b..5532149c 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -152,6 +152,12 @@ namespace QUtil QPDF_DLL std::string toUTF16(unsigned long uval); + // Convert a UTF-8 encoded string to ASCII by replacing all + // characters outside of ascii with the given unknown_char. + QPDF_DLL + std::string utf8_to_ascii( + std::string const& utf8, char unknown_char = '?'); + // If secure random number generation is supported on your // platform and qpdf was not compiled with insecure random number // generation, this returns a cryptographically secure random |