summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-16 12:52:05 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-16 12:52:05 +0100
commit3e2109ab373d8830146efbcb0af735ff58f9ad32 (patch)
tree040035e860b627bf7ffd550722da46a0c328c147
parent38d8362c09e1d41c85f808995ad93a3bed238cf7 (diff)
downloadqpdf-3e2109ab373d8830146efbcb0af735ff58f9ad32.tar.zst
Remove special case for 0xad for 10.6.2.release-qpdf-10.6.2
-rw-r--r--libqpdf/QUtil.cc7
-rw-r--r--libtests/qtest/qutil/qutil.out2
-rw-r--r--qpdf/test_driver.cc8
3 files changed, 8 insertions, 9 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc
index d0802334..d56dd14f 100644
--- a/libqpdf/QUtil.cc
+++ b/libqpdf/QUtil.cc
@@ -2293,10 +2293,9 @@ transcode_utf8(std::string const& utf8_val, std::string& result,
}
else if ((codepoint == 0xad) && (encoding == e_pdfdoc))
{
- // PDFDocEncoding omits 0x00ad (soft hyphen), but rather
- // than treating it as undefined, map it to a regular
- // hyphen.
- result.append(1, '-');
+ // PDFDocEncoding omits 0x00ad (soft hyphen).
+ okay = false;
+ result.append(1, unknown);
}
else if ((codepoint > 160) && (codepoint < 256) &&
((encoding == e_winansi) || (encoding == e_pdfdoc)))
diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out
index fc6a0df1..e9c53170 100644
--- a/libtests/qtest/qutil/qutil.out
+++ b/libtests/qtest/qutil/qutil.out
@@ -90,7 +90,7 @@ alternatives
0: 717561636b
done alternatives
w˘wˇwˆw˙w˝w˛w˚w˜w�w�w�w
-w?w?w?w?w?w?w?w?w?w?w-w
+w?w?w?w?w?w?w?w?w?w?w?w
done other characters
---- whoami
quack1
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index e3fc7007..aee3cd53 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -3335,14 +3335,14 @@ static void test_86(QPDF& pdf, char const* arg2)
std::string utf16_val("\xfe\xff\x00\x1f", 4);
std::string result;
assert(QUtil::utf8_to_ascii(utf8_val, result, '?'));
- assert(result == "\x1f");
+ assert(result == utf8_val);
assert(! QUtil::utf8_to_pdf_doc(utf8_val, result, '?'));
assert(result == "?");
assert(QUtil::utf8_to_utf16(utf8_val) == utf16_val);
assert(QUtil::utf16_to_utf8(utf16_val) == utf8_val);
- auto h = QPDFObjectHandle::newUnicodeString("\x1f");
- assert(h.getStringValue() == std::string("\xfe\xff\x00\x1f", 4));
- assert(h.getUTF8Value() == "\x1f");
+ auto h = QPDFObjectHandle::newUnicodeString(utf8_val);
+ assert(h.getStringValue() == utf16_val);
+ assert(h.getUTF8Value() == utf8_val);
}
void runtest(int n, char const* filename1, char const* arg2)