Commit 2d402e451cad84e28a988eefbfcdbd580cf733fc

Authored by Jay Berkenbilt
1 parent 54d8e920

Format code

libqpdf/QPDFObjectHandle.cc
1 1 #include <qpdf/QPDFObjectHandle.hh>
2 2  
3 3 #include <qpdf/BufferInputSource.hh>
  4 +#include <qpdf/JSON_writer.hh>
4 5 #include <qpdf/Pl_Buffer.hh>
5 6 #include <qpdf/Pl_QPDFTokenizer.hh>
6   -#include <qpdf/JSON_writer.hh>
7 7 #include <qpdf/QPDF.hh>
8 8 #include <qpdf/QPDFExc.hh>
9 9 #include <qpdf/QPDFLogger.hh>
... ...
libqpdf/QPDF_String.cc
... ... @@ -51,22 +51,21 @@ QPDF_String::writeJSON(int json_version, JSON::Writer&amp; p)
51 51 {
52 52 auto candidate = getUTF8Val();
53 53 if (json_version == 1) {
54   -
55 54 p << "\"" << JSON::Writer::encode_string(candidate) << "\"";
56 55 } else {
57 56 // See if we can unambiguously represent as Unicode.
58 57 if (QUtil::is_utf16(this->val) || QUtil::is_explicit_utf8(this->val)) {
59   - p << "\"u:" << JSON::Writer::encode_string(candidate) <<"\"";
  58 + p << "\"u:" << JSON::Writer::encode_string(candidate) << "\"";
60 59 return;
61 60 } else if (!useHexString()) {
62 61 std::string test;
63 62 if (QUtil::utf8_to_pdf_doc(candidate, test, '?') && (test == this->val)) {
64 63 // This is a PDF-doc string that can be losslessly encoded as Unicode.
65   - p << "\"u:" << JSON::Writer::encode_string(candidate) <<"\"";
  64 + p << "\"u:" << JSON::Writer::encode_string(candidate) << "\"";
66 65 return;
67 66 }
68 67 }
69   - p << "\"b:" << QUtil::hex_encode(val) <<"\"";
  68 + p << "\"b:" << QUtil::hex_encode(val) << "\"";
70 69 }
71 70 }
72 71  
... ...