From b9af421ef788b94fcbf18ecf702cec3ba9a018b7 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 17 Jan 2022 18:38:12 -0500 Subject: Add missing \f support for JSON string encoder --- libqpdf/JSON.cc | 3 +++ qpdf/qtest/qpdf/json-outlines-with-actions.out | 4 ++-- qpdf/qtest/qpdf/json-outlines-with-old-root-dests.out | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc index c656bb14..a45dbd2e 100644 --- a/libqpdf/JSON.cc +++ b/libqpdf/JSON.cc @@ -181,6 +181,9 @@ JSON::encode_string(std::string const& str) case '\b': result += "\\b"; break; + case '\f': + result += "\\f"; + break; case '\n': result += "\\n"; break; diff --git a/qpdf/qtest/qpdf/json-outlines-with-actions.out b/qpdf/qtest/qpdf/json-outlines-with-actions.out index 9755d0b8..bfc67cfd 100644 --- a/qpdf/qtest/qpdf/json-outlines-with-actions.out +++ b/qpdf/qtest/qpdf/json-outlines-with-actions.out @@ -1653,8 +1653,8 @@ "99 0 R": 46, "trailer": { "/ID": [ - "Õ+\u000c\u0017Â\u0016Pib®gC¯ì&\u000f", - "Õ+\u000c\u0017Â\u0016Pib®gC¯ì&\u000f" + "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f", + "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f" ], "/Root": "1 0 R", "/Size": 109 diff --git a/qpdf/qtest/qpdf/json-outlines-with-old-root-dests.out b/qpdf/qtest/qpdf/json-outlines-with-old-root-dests.out index af3ce99c..2d4a81d4 100644 --- a/qpdf/qtest/qpdf/json-outlines-with-old-root-dests.out +++ b/qpdf/qtest/qpdf/json-outlines-with-old-root-dests.out @@ -1651,8 +1651,8 @@ "99 0 R": 45, "trailer": { "/ID": [ - "Õ+\u000c\u0017Â\u0016Pib®gC¯ì&\u000f", - "Õ+\u000c\u0017Â\u0016Pib®gC¯ì&\u000f" + "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f", + "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f" ], "/Root": "1 0 R", "/Size": 108 -- cgit v1.2.3-54-g00ecf