aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-05 19:00:18 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-06 04:59:27 +0100
commit089ce5902ec155ff3dce7bed7c12006a587d3db0 (patch)
tree8fdda222bc40b051ab811f621e8ce5b7661c6df5 /include
parentae18bfd142f2f9a19505971d4d197cb37ee86eee (diff)
downloadqpdf-089ce5902ec155ff3dce7bed7c12006a587d3db0.tar.zst
Move utf8_to_utf16 into QUtil
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QUtil.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh
index 5532149c..c7473bf3 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -152,8 +152,14 @@ 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.
+ // Convert a UTF-8 encoded string to UTF-16. Unrepresentable code
+ // points are converted to U+FFFD.
+ QPDF_DLL
+ std::string utf8_to_utf16(std::string const& utf8);
+
+ // Convert a UTF-8 encoded string to the specified single-byte
+ // encoding system by replacing all unsupported characters with
+ // the given unknown_char.
QPDF_DLL
std::string utf8_to_ascii(
std::string const& utf8, char unknown_char = '?');