From 8ff20b00897acecc6908c98fab72db1c57692abb Mon Sep 17 00:00:00 2001 From: m-holger Date: Mon, 29 Jan 2024 13:22:58 +0000 Subject: Allow "n:/pdf-syntax" JSON syntax for dictionary keys --- libqpdf/QPDF_json.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libqpdf/QPDF_json.cc') diff --git a/libqpdf/QPDF_json.cc b/libqpdf/QPDF_json.cc index 7951b1e4..33211f14 100644 --- a/libqpdf/QPDF_json.cc +++ b/libqpdf/QPDF_json.cc @@ -666,7 +666,9 @@ QPDF::JSONReactor::dictionaryItem(std::string const& key, JSON const& value) if (dict.isStream()) { dict = dict.getDict(); } - dict.replaceKey(key, makeObject(value)); + dict.replaceKey( + is_pdf_name(key) ? QPDFObjectHandle::parse(key.substr(2)).getName() : key, + makeObject(value)); } } else { throw std::logic_error("QPDF_json: unknown state " + std::to_string(state)); -- cgit v1.2.3-54-g00ecf