Commit 1ec561daa493713ab83057c6a18383947f56c451

Authored by Jay Berkenbilt
1 parent 6c5e5906

Add more names and strings in good13

* native UTF-8 strings
* names whose PDF and canonical syntax differ in both dictionary key
  positions and other positions

For json, names are converted both as names and directly when used as
dictionary keys.
qpdf/qtest/qpdf/good13.out
@@ -2,8 +2,9 @@ @@ -2,8 +2,9 @@
2 /QTest is a dictionary 2 /QTest is a dictionary
3 /hex strings is direct 3 /hex strings is direct
4 /indirect is indirect 4 /indirect is indirect
  5 + /names is direct
5 /nesting is direct 6 /nesting is direct
6 /strings is direct 7 /strings is direct
7 unparse: 7 0 R 8 unparse: 7 0 R
8 -unparseResolved: << /hex#20strings [ (Potato) <01020300040560> (AB) ] /indirect 8 0 R /nesting << /a [ 1 2 << /x (y) >> [ (z) ] ] /b << / (legal) /a [ 1 2 ] >> >> /strings [ (one) <24a2> () (\(\)) (\() (\)) (a\f\b\t\r\nb) <410042> (a\nb) (a b) ] >> 9 +unparseResolved: << /hex#20strings [ (Potato) <01020300040560> (AB) ] /indirect 8 0 R /names [ /nesting /hex#20strings /text#2fplain ] /nesting << /a [ 1 2 << /x (y) >> [ (z) ] ] /b << / (legal) /a [ 1 2 ] >> >> /strings [ (one) <24a2> () (\(\)) (\() (\)) (a\f\b\t\r\nb) (") ("") ("\("\)") <410042> (a\nb) (a b) <efbbbfcf80> <efbbbff09fa594> ] >>
9 test 1 done 10 test 1 done
qpdf/qtest/qpdf/good13.pdf
1 -%PDF-1.3 1 +%PDF-2.0
2 1 0 obj 2 1 0 obj
3 << 3 <<
4 /Type /Catalog 4 /Type /Catalog
@@ -63,9 +63,9 @@ endobj @@ -63,9 +63,9 @@ endobj
63 63
64 7 0 obj 64 7 0 obj
65 << 65 <<
66 - /strings [(one) ($\242) () (()) (\() (\)) (a\f\b\t\r\nb) (AA\000B) (a00B) (a 66 + /strings [(one) ($\242) () (()) (\() (\)) (a\f\b\t\r\nb) (") ("") ("(")") (AA\000B) (a00B) (a
67 b) (a \ 67 b) (a \
68 -b)] 68 +b) (π) (🥔)]
69 /hex#20strings [<506F7461746f> <010 203 0004056> <41 69 /hex#20strings [<506F7461746f> <010 203 0004056> <41
70 42>] 70 42>]
71 /indirect 8 0 R 71 /indirect 8 0 R
@@ -73,6 +73,7 @@ b)] @@ -73,6 +73,7 @@ b)]
73 /a [1 2 << /x (y) >> [(z)]] 73 /a [1 2 << /x (y) >> [(z)]]
74 /b <</a [1 2] / (legal)>> 74 /b <</a [1 2] / (legal)>>
75 >> 75 >>
  76 + /names [/n#65sting /hex#20strings /text#2fplain]
76 >> 77 >>
77 endobj 78 endobj
78 79
@@ -90,12 +91,12 @@ xref @@ -90,12 +91,12 @@ xref
90 0000000403 00000 n 91 0000000403 00000 n
91 0000000438 00000 n 92 0000000438 00000 n
92 0000000556 00000 n 93 0000000556 00000 n
93 -0000000822 00000 n 94 +0000000908 00000 n
94 trailer << 95 trailer <<
95 /Size 9 96 /Size 9
96 /Root 1 0 R 97 /Root 1 0 R
97 /QTest 7 0 R 98 /QTest 7 0 R
98 >> 99 >>
99 startxref 100 startxref
100 -846 101 +932
101 %%EOF 102 %%EOF
qpdf/qtest/qpdf/good13.qdf
1 -%PDF-1.3 1 +%PDF-2.0
2 %¿÷¢þ 2 %¿÷¢þ
3 %QDF-1.0 3 %QDF-1.0
4 4
@@ -19,6 +19,11 @@ endobj @@ -19,6 +19,11 @@ endobj
19 (AB) 19 (AB)
20 ] 20 ]
21 /indirect 4 0 R 21 /indirect 4 0 R
  22 + /names [
  23 + /nesting
  24 + /hex#20strings
  25 + /text#2fplain
  26 + ]
22 /nesting << 27 /nesting <<
23 /a [ 28 /a [
24 1 29 1
@@ -46,9 +51,14 @@ endobj @@ -46,9 +51,14 @@ endobj
46 (\() 51 (\()
47 (\)) 52 (\))
48 (a\f\b\t\r\nb) 53 (a\f\b\t\r\nb)
  54 + (")
  55 + ("")
  56 + ("\("\)")
49 <410042> 57 <410042>
50 (a\nb) 58 (a\nb)
51 (a b) 59 (a b)
  60 + <efbbbfcf80>
  61 + <efbbbff09fa594>
52 ] 62 ]
53 >> 63 >>
54 endobj 64 endobj
@@ -134,13 +144,13 @@ xref @@ -134,13 +144,13 @@ xref
134 0000000000 65535 f 144 0000000000 65535 f
135 0000000052 00000 n 145 0000000052 00000 n
136 0000000133 00000 n 146 0000000133 00000 n
137 -0000000576 00000 n  
138 -0000000675 00000 n  
139 -0000000736 00000 n  
140 -0000000978 00000 n  
141 -0000001077 00000 n  
142 -0000001123 00000 n  
143 -0000001268 00000 n 147 +0000000710 00000 n
  148 +0000000809 00000 n
  149 +0000000870 00000 n
  150 +0000001112 00000 n
  151 +0000001211 00000 n
  152 +0000001257 00000 n
  153 +0000001402 00000 n
144 trailer << 154 trailer <<
145 /QTest 2 0 R 155 /QTest 2 0 R
146 /Root 1 0 R 156 /Root 1 0 R
@@ -148,5 +158,5 @@ trailer &lt;&lt; @@ -148,5 +158,5 @@ trailer &lt;&lt;
148 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] 158 /ID [<31415926535897932384626433832795><31415926535897932384626433832795>]
149 >> 159 >>
150 startxref 160 startxref
151 -1303 161 +1437
152 %%EOF 162 %%EOF