aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_json.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2024-01-29 14:22:58 +0100
committerm-holger <m-holger@kubitscheck.org>2024-01-29 14:22:58 +0100
commit8ff20b00897acecc6908c98fab72db1c57692abb (patch)
tree43861ce541d68eee3bb7cc9f7cd85de86a22e386 /libqpdf/QPDF_json.cc
parent4660e23262fd3606d0b9ef7db9bcc315783b16e3 (diff)
downloadqpdf-8ff20b00897acecc6908c98fab72db1c57692abb.tar.zst
Allow "n:/pdf-syntax" JSON syntax for dictionary keys
Diffstat (limited to 'libqpdf/QPDF_json.cc')
-rw-r--r--libqpdf/QPDF_json.cc4
1 files changed, 3 insertions, 1 deletions
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));