]> diplodocus.org Git - nmh/blob - test/mhshow/test-textcharset
Wrapped uses of %{charset} in mhn.defaults with double quotes.
[nmh] / test / mhshow / test-textcharset
1 #!/bin/sh
2 ##########################################################
3 #
4 # Test display of text/plain parts with charset conversion
5 #
6 ##########################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname "$0"`/../..
12 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "$MH_OBJ_DIR/test/common.sh"
16
17 setup_test
18
19 if test "$ICONV_ENABLED" -eq 0; then
20 test_skip 'test-textcharset requires that nmh have been built with iconv'
21 fi
22
23 require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
24
25 expected="$MH_TEST_DIR"/$$.expected
26 actual="$MH_TEST_DIR"/$$.actual
27
28 # check charset conversion
29 msgfile=`mhpath new`
30 msgnum=`basename $msgfile`
31 cat >"$msgfile" <<'EOF'
32 From: foo@example.edu
33 To: bar@example.edu
34 Subject: test display with charset conversion
35 MIME-Version: 1.0
36 Content-Type: text/plain; charset=windows-1252
37 Content-Transfer-Encoding: quoted-printable
38 Date: Sun, 18 Dec 2005 00:52:39 +0100
39
40 4 =F7 2 =3D 2
41 EOF
42
43 cat >"$expected" <<EOF
44 [ Message inbox:$msgnum ]
45 Date: Sun, 18 Dec 2005 00:52:39 +0100
46 To: bar@example.edu
47 From: foo@example.edu
48 Subject: test display with charset conversion
49
50 MIME-Version: 1.0
51
52 [ part - text/plain - 11B ]
53 4 ÷ 2 = 2
54 EOF
55
56 run_prog mhshow last >"$actual" 2>&1
57 check "$expected" "$actual" : check charset conversion
58
59 cat >>"$MH" <<'EOF'
60 mhshow-show-text/plain: echo %{charset}
61 EOF
62
63
64 # check expansion of %{charset} by itself
65 msgfile=`mhpath new`
66 msgnum=`basename $msgfile`
67 cat >"$msgfile" <<'EOF'
68 From: foo@example.edu
69 To: bar@example.edu
70 Subject: test display with %{charset} expansion
71 MIME-Version: 1.0
72 Content-Type: text/plain; charset=windows-1252
73 Content-Transfer-Encoding: quoted-printable
74 Date: Sun, 18 Dec 2005 00:52:39 +0100
75
76 4 =F7 2 =3D 2
77 EOF
78
79 cat >"$expected" <<EOF
80 [ Message inbox:$msgnum ]
81 Date: Sun, 18 Dec 2005 00:52:39 +0100
82 To: bar@example.edu
83 From: foo@example.edu
84 Subject: test display with %{charset} expansion
85
86 MIME-Version: 1.0
87
88 UTF-8
89 EOF
90
91 run_prog mhshow last >"$actual" 2>&1
92 check "$expected" "$actual" : check %{charset} by itself
93
94
95 # check expansion of empty %{charset} by itself
96 msgfile=`mhpath new`
97 omsgnum=$msgnum
98 msgnum=`basename $msgfile`
99 cat >"$msgfile" <<'EOF'
100 From: foo@example.edu
101 To: bar@example.edu
102 Subject: test display with empty %{charset} expansion
103 MIME-Version: 1.0
104 Content-Type: text/plain
105 Content-Transfer-Encoding: quoted-printable
106 Date: Sun, 18 Dec 2005 00:52:39 +0100
107
108 4 =F7 2 =3D 2
109 EOF
110
111 cat >"$expected" <<EOF
112 [ Message inbox:$msgnum ]
113 Date: Sun, 18 Dec 2005 00:52:39 +0100
114 To: bar@example.edu
115 From: foo@example.edu
116 Subject: test display with empty %{charset} expansion
117
118 MIME-Version: 1.0
119
120
121 EOF
122
123 run_prog mhshow last >"$actual" 2>&1
124 check "$expected" "$actual" : check empty %{charset} by itself
125
126
127 grep -v 'mhshow-show-text/plain:' "$MH" >"$MH.new"
128 mv -f "$MH.new" "$MH"
129 cat >>"$MH" <<'EOF'
130 mhshow-show-text/plain: charset=%{charset}; echo ${charset:+-I $charset}
131 EOF
132
133 # check expansion of embedded %{charset} with no text following
134 cat >"$expected" <<EOF
135 [ Message inbox:$omsgnum ]
136 Date: Sun, 18 Dec 2005 00:52:39 +0100
137 To: bar@example.edu
138 From: foo@example.edu
139 Subject: test display with %{charset} expansion
140
141 MIME-Version: 1.0
142
143 -I UTF-8
144 EOF
145
146 run_prog mhshow prev >"$actual" 2>&1 # NB: "mhshow prev" !!!
147 check "$expected" "$actual" : check embedded %{charset} with no text
148
149
150 # check expansion of empty embedded %{charset} with no text following
151 cat >"$expected" <<EOF
152 [ Message inbox:$msgnum ]
153 Date: Sun, 18 Dec 2005 00:52:39 +0100
154 To: bar@example.edu
155 From: foo@example.edu
156 Subject: test display with empty %{charset} expansion
157
158 MIME-Version: 1.0
159
160
161 EOF
162
163 run_prog mhshow last >"$actual" 2>&1
164 check "$expected" "$actual" : check empty embedded %{charset} with no text following
165
166
167 sed -e 's%\(mhshow-show-text/plain:.*\)%\1 file%' "$MH" >"$MH.new"
168 mv -f "$MH.new" "$MH"
169
170 # check expansion of embedded %{charset} with text following
171 cat >"$expected" <<EOF
172 [ Message inbox:$omsgnum ]
173 Date: Sun, 18 Dec 2005 00:52:39 +0100
174 To: bar@example.edu
175 From: foo@example.edu
176 Subject: test display with %{charset} expansion
177
178 MIME-Version: 1.0
179
180 -I UTF-8 file
181 EOF
182
183 run_prog mhshow prev >"$actual" 2>&1 # NB: "mhshow prev" !!!
184 check "$expected" "$actual" : check embedded %{charset} with text following
185
186
187 # check expansion of empty embedded %{charset} with text following
188 cat >"$expected" <<EOF
189 [ Message inbox:$msgnum ]
190 Date: Sun, 18 Dec 2005 00:52:39 +0100
191 To: bar@example.edu
192 From: foo@example.edu
193 Subject: test display with empty %{charset} expansion
194
195 MIME-Version: 1.0
196
197 file
198 EOF
199
200 run_prog mhshow last >"$actual" 2>&1
201 check "$expected" "$actual" : check empty embedded %{charset} with text following
202
203
204 sed -e 's/charset/method/g' "$MH" >"$MH.new"
205 mv -f "$MH.new" "$MH"
206
207 # check parameter value quoting
208 msgfile=`mhpath new`
209 msgnum=`basename $msgfile`
210 cat >"$msgfile" <<'EOF'
211 From: foo@example.edu
212 To: bar@example.edu
213 Subject: test C-T parameter expansion quoting
214 MIME-Version: 1.0
215 Content-Type: text/plain; method=$QUOTEME'
216 Content-Transfer-Encoding: quoted-printable
217 Date: Sun, 18 Dec 2005 00:52:39 +0100
218
219 4 =F7 2 =3D 2
220 EOF
221
222 cat >"$expected" <<EOF
223 [ Message inbox:$msgnum ]
224 EOF
225 cat >>"$expected" <<'EOF'
226 Date: Sun, 18 Dec 2005 00:52:39 +0100
227 To: bar@example.edu
228 From: foo@example.edu
229 Subject: test C-T parameter expansion quoting
230
231 MIME-Version: 1.0
232
233 -I $QUOTEME' file
234 EOF
235
236 run_prog mhshow last >"$actual" 2>&1
237 check "$expected" "$actual" : check parameter value quoting
238
239
240 sed -e 's/method/unknown/g' "$MH" >"$MH.new"
241 mv -f "$MH.new" "$MH"
242
243 # check that unknown parameter is not expanded
244 msgfile=`mhpath new`
245 msgnum=`basename $msgfile`
246 cat >"$msgfile" <<'EOF'
247 From: foo@example.edu
248 To: bar@example.edu
249 Subject: test display with unknown C-T parameter expansion
250 MIME-Version: 1.0
251 Content-Type: text/plain; charset=windows-1252
252 Content-Transfer-Encoding: quoted-printable
253 Date: Sun, 18 Dec 2005 00:52:39 +0100
254
255 4 =F7 2 =3D 2
256 EOF
257
258 cat >"$expected" <<EOF
259 [ Message inbox:$msgnum ]
260 Date: Sun, 18 Dec 2005 00:52:39 +0100
261 To: bar@example.edu
262 From: foo@example.edu
263 Subject: test display with unknown C-T parameter expansion
264
265 MIME-Version: 1.0
266
267 file
268 EOF
269
270 run_prog mhshow last >"$actual" 2>&1
271 check "$expected" "$actual" : check unknown parameter is not expanded
272
273
274 grep -v '^mhshow-show-text/plain: ' "$MH" >>"$MH.new"
275 mv -f "$MH.new" "$MH"
276 cat >>"$MH" <<EOF
277 mhshow-show-text/plain: true '%F' %F
278 EOF
279
280 # check parameter value quoting with text following
281 msgfile=`mhpath new`
282 msgnum=`basename $msgfile`
283 cat >"$msgfile" <<'EOF'
284 From: foo@example.edu
285 To: bar@example.edu
286 Subject: check parameter value quoting with text following
287 MIME-Version: 1.0
288 Content-Type: text/plain
289 Date: Sun, 18 Dec 2005 00:52:39 +0100
290
291 This is a test.
292 EOF
293
294 cat >"$expected" <<EOF
295 [ Message inbox:$msgnum ]
296 Date: Sun, 18 Dec 2005 00:52:39 +0100
297 To: bar@example.edu
298 From: foo@example.edu
299 Subject: check parameter value quoting with text following
300
301 MIME-Version: 1.0
302
303 EOF
304
305 run_prog mhshow last >"$actual" 2>&1
306 check "$expected" "$actual" : parameter value quoting with text following
307
308 # check malicious parameter value quoting
309 msgfile=`mhpath new`
310 msgnum=`basename $msgfile`
311 cat >"$msgfile" <<'EOF'
312 Subject: shows difficulty of quoting with /bin/sh -c
313 MIME-Version: 1.0
314 Content-Type: text/html; charset="oops'; echo should not see this!"
315
316 EOF
317
318 cat >"$expected" <<EOF
319 [ part - text/html - 0B ]
320 EOF
321
322 run_prog mhshow -noheader -form mhl.null last >"$actual" 2>&1
323 check "$expected" "$actual" : malicious parameter value quoting
324
325 #
326 # test a large file that needs to be converted to UTF-8
327 #
328
329 grep -v '^mhshow-show-text/plain: ' "$MH" >>"$MH.new"
330 mv -f "$MH.new" "$MH"
331 msgfile=`mhpath new`
332 msgnum=`basename $msgfile`
333 cat >"$msgfile" <<'EOF'
334 From: foo@example.edu
335 To: bar@example.edu
336 Subject: check charset conversion of a large file
337 MIME-Version: 1.0
338 Content-Type: text/plain; charset="windows-1252"
339 Content-Transfer-Encoding: quoted-printable
340 Date: Sun, 18 Dec 2005 00:52:39 +0100
341
342 1. The Earthquake
343
344
345 The train from 'Frisco was very late. It should have arrived at
346 Hugson's Siding at midnight, but it was already five o'clock and the
347 gray dawn was breaking in the east when the little train slowly rumbled
348 up to the open shed that served for the station-house. As it came to a
349 stop the conductor called out in a loud voice:
350
351 =93Hugson's Siding!=94
352
353 At once a little girl rose from her seat and walked to the door of the
354 car, carrying a wicker suit-case in one hand and a round bird-cage
355 covered up with newspapers in the other, while a parasol was tucked
356 under her arm. The conductor helped her off the car and then the
357 engineer started his train again, so that it puffed and groaned and
358 moved slowly away up the track. The reason he was so late was because
359 all through the night there were times when the solid earth shook and
360 trembled under him, and the engineer was afraid that at any moment the
361 rails might spread apart and an accident happen to his passengers. So
362 he moved the cars slowly and with caution.
363
364 The little girl stood still to watch until the train had disappeared
365 around a curve; then she turned to see where she was.
366
367 The shed at Hugson's Siding was bare save for an old wooden bench, and
368 did not look very inviting. As she peered through the soft gray light
369 not a house of any sort was visible near the station, nor was any
370 person in sight; but after a while the child discovered a horse and
371 buggy standing near a group of trees a short distance away. She walked
372 toward it and found the horse tied to a tree and standing motionless,
373 with its head hanging down almost to the ground. It was a big horse,
374 tall and bony, with long legs and large knees and feet. She could
375 count his ribs easily where they showed through the skin of his body,
376 and his head was long and seemed altogether too big for him, as if it
377 did not fit. His tail was short and scraggly, and his harness had been
378 broken in many places and fastened together again with cords and bits
379 of wire. The buggy seemed almost new, for it had a shiny top and side
380 curtains. Getting around in front, so that she could look inside, the
381 girl saw a boy curled up on the seat, fast asleep.
382
383 She set down the bird-cage and poked the boy with her parasol.
384 Presently he woke up, rose to a sitting position and rubbed his eyes
385 briskly.
386
387 =93Hello!=94 he said, seeing her, =93are you Dorothy Gale?=94
388
389 =93Yes,=94 she answered, looking gravely at his tousled hair and blinking
390 gray eyes. =93Have you come to take me to Hugson's Ranch?=94
391
392 =93Of course,=94 he answered. =93Train in?=94
393
394 =93I couldn't be here if it wasn't,=94 she said.
395
396 He laughed at that, and his laugh was merry and frank. Jumping out of
397 the buggy he put Dorothy's suit-case under the seat and her bird-cage
398 on the floor in front.
399
400 =93Canary-birds?=94 he asked.
401
402 =93Oh no; it's just Eureka, my kitten. I thought that was the best way
403 to carry her.=94
404
405 The boy nodded.
406
407 =93Eureka's a funny name for a cat,=94 he remarked.
408
409 =93I named my kitten that because I found it,=94 she explained. =93Uncle
410 Henry says 'Eureka' means 'I have found it.'=94
411
412 =93All right; hop in.=94
413
414 She climbed into the buggy and he followed her. Then the boy picked up
415 the reins, shook them, and said =93Gid-dap!=94
416
417 The horse did not stir. Dorothy thought he just wiggled one of his
418 drooping ears, but that was all.
419
420 =93Gid-dap!=94 called the boy, again.
421
422 The horse stood still.
423
424 =93Perhaps,=94 said Dorothy, =93if you untied him, he would go.=94
425
426 The boy laughed cheerfully and jumped out.
427
428 =93Guess I'm half asleep yet,=94 he said, untying the horse. =93But Jim
429 knows his business all right--don't you, Jim?=94 patting the long nose of
430 the animal.
431
432 Then he got into the buggy again and took the reins, and the horse at
433 once backed away from the tree, turned slowly around, and began to trot
434 down the sandy road which was just visible in the dim light.
435
436 =93Thought that train would never come,=94 observed the boy. =93I've wait=
437 ed
438 at that station for five hours.=94
439
440 =93We had a lot of earthquakes,=94 said Dorothy. =93Didn't you feel the
441 ground shake?=94
442
443 =93Yes; but we're used to such things in California,=94 he replied. =93Th=
444 ey
445 don't scare us much.=94
446
447 =93The conductor said it was the worst quake he ever knew.=94
448
449 =93Did he? Then it must have happened while I was asleep,=94 he said
450 thoughtfully.
451
452 =93How is Uncle Henry?=94 she enquired, after a pause during which the
453 horse continued to trot with long, regular strides.
454
455 =93He's pretty well. He and Uncle Hugson have been having a fine visit.=94
456
457 =93Is Mr. Hugson your uncle?=94 she asked.
458
459 =93Yes. Uncle Bill Hugson married your Uncle Henry's wife's sister; so
460 we must be second cousins,=94 said the boy, in an amused tone. =93I work
461 for Uncle Bill on his ranch, and he pays me six dollars a month and my
462 board.=94
463
464 =93Isn't that a great deal?=94 she asked, doubtfully.
465
466 =93Why, it's a great deal for Uncle Hugson, but not for me. I'm a
467 splendid worker. I work as well as I sleep,=94 he added, with a laugh.
468
469 =93What is your name?=94 said Dorothy, thinking she liked the boy's manner
470 and the cheery tone of his voice.
471
472 =93Not a very pretty one,=94 he answered, as if a little ashamed. =93My
473 whole name is Zebediah; but folks just call me 'Zeb.' You've been to
474 Australia, haven't you?=94
475
476 =93Yes; with Uncle Henry,=94 she answered. =93We got to San Francisco a w=
477 eek
478 ago, and Uncle Henry went right on to Hugson's Ranch for a visit while
479 I stayed a few days in the city with some friends we had met.=94
480
481 =93How long will you be with us?=94 he asked.
482
483 =93Only a day. Tomorrow Uncle Henry and I must start back for Kansas.
484 We've been away for a long time, you know, and so we're anxious to get
485 home again.=94
486
487 The boy flicked the big, boney horse with his whip and looked
488 thoughtful. Then he started to say something to his little companion,
489 but before he could speak the buggy began to sway dangerously from side
490 to side and the earth seemed to rise up before them. Next minute there
491 was a roar and a sharp crash, and at her side Dorothy saw the ground
492 open in a wide crack and then come together again.
493
494 =93Goodness!=94 she cried, grasping the iron rail of the seat. =93What wa=
495 s
496 that?=94
497
498 =93That was an awful big quake,=94 replied Zeb, with a white face. =93It
499 almost got us that time, Dorothy.=94
500
501 The horse had stopped short, and stood firm as a rock. Zeb shook the
502 reins and urged him to go, but Jim was stubborn. Then the boy cracked
503 his whip and touched the animal's flanks with it, and after a low moan
504 of protest Jim stepped slowly along the road.
505
506 Neither the boy nor the girl spoke again for some minutes. There was a
507 breath of danger in the very air, and every few moments the earth would
508 shake violently. Jim's ears were standing erect upon his head and
509 every muscle of his big body was tense as he trotted toward home. He
510 was not going very fast, but on his flanks specks of foam began to
511 appear and at times he would tremble like a leaf.
512
513 The sky had grown darker again and the wind made queer sobbing sounds
514 as it swept over the valley.
515
516 Suddenly there was a rending, tearing sound, and the earth split into
517 another great crack just beneath the spot where the horse was standing.
518 With a wild neigh of terror the animal fell bodily into the pit,
519 drawing the buggy and its occupants after him.
520
521 Dorothy grabbed fast hold of the buggy top and the boy did the same.
522 The sudden rush into space confused them so that they could not think.
523
524 Blackness engulfed them on every side, and in breathless silence they
525 waited for the fall to end and crush them against jagged rocks or for
526 the earth to close in on them again and bury them forever in its
527 dreadful depths.
528
529 The horrible sensation of falling, the darkness and the terrifying
530 noises, proved more than Dorothy could endure and for a few moments the
531 little girl lost consciousness. Zeb, being a boy, did not faint, but
532 he was badly frightened, and clung to the buggy seat with a tight grip,
533 expecting every moment would be his last.
534
535
536
537
538 2. The Glass City
539
540
541 When Dorothy recovered her senses they were still falling, but not so
542 fast. The top of the buggy caught the air like a parachute or an
543 umbrella filled with wind, and held them back so that they floated
544 downward with a gentle motion that was not so very disagreeable to
545 bear. The worst thing was their terror of reaching the bottom of this
546 great crack in the earth, and the natural fear that sudden death was
547 about to overtake them at any moment. Crash after crash echoed far
548 above their heads, as the earth came together where it had split, and
549 stones and chunks of clay rattled around them on every side. These
550 they could not see, but they could feel them pelting the buggy top, and
551 Jim screamed almost like a human being when a stone overtook him and
552 struck his boney body. They did not really hurt the poor horse,
553 because everything was falling together; only the stones and rubbish
554 fell faster than the horse and buggy, which were held back by the
555 pressure of the air, so that the terrified animal was actually more
556 frightened than he was injured.
557
558 How long this state of things continued Dorothy could not even guess,
559 she was so greatly bewildered. But bye and bye, as she stared ahead
560 into the black chasm with a beating heart, she began to dimly see the
561 form of the horse Jim--his head up in the air, his ears erect and his
562 long legs sprawling in every direction as he tumbled through space.
563 Also, turning her head, she found that she could see the boy beside
564 her, who had until now remained as still and silent as she herself.
565
566 Dorothy sighed and commenced to breathe easier. She began to realize
567 that death was not in store for her, after all, but that she had merely
568 started upon another adventure, which promised to be just as queer and
569 unusual as were those she had before encountered.
570
571 With this thought in mind the girl took heart and leaned her head over
572 the side of the buggy to see where the strange light was coming from.
573 Far below her she found six great glowing balls suspended in the air.
574 The central and largest one was white, and reminded her of the sun.
575 Around it were arranged, like the five points of a star, the other five
576 brilliant balls; one being rose colored, one violet, one yellow, one
577 blue and one orange. This splendid group of colored suns sent rays
578 darting in every direction, and as the horse and buggy--with Dorothy
579 and Zeb--sank steadily downward and came nearer to the lights, the rays
580 began to take on all the delicate tintings of a rainbow, growing more
581 and more distinct every moment until all the space was brilliantly
582 illuminated.
583
584 Dorothy was too dazed to say much, but she watched one of Jim's big
585 ears turn to violet and the other to rose, and wondered that his tail
586 should be yellow and his body striped with blue and orange like the
587 stripes of a zebra. Then she looked at Zeb, whose face was blue and
588 whose hair was pink, and gave a little laugh that sounded a bit nervous.
589
590 =93Isn't it funny?=94 she said.
591
592 The boy was startled and his eyes were big. Dorothy had a green streak
593 through the center of her face where the blue and yellow lights came
594 together, and her appearance seemed to add to his fright.
595
596 =93I--I don't s-s-see any-thing funny--'bout it!=94 he stammered.
597
598 Just then the buggy tipped slowly over upon its side, the body of the
599 horse tipping also. But they continued to fall, all together, and the
600 boy and girl had no difficulty in remaining upon the seat, just as they
601 were before. Then they turned bottom side up, and continued to roll
602 slowly over until they were right side up again. During this time Jim
603 struggled frantically, all his legs kicking the air; but on finding
604 himself in his former position the horse said, in a relieved tone of
605 voice:
606
607 =93Well, that's better!=94
608
609 Dorothy and Zeb looked at one another in wonder.
610
611 =93Can your horse talk?=94 she asked.
612
613 =93Never knew him to, before,=94 replied the boy.
614
615 =93Those were the first words I ever said,=94 called out the horse, who ha=
616 d
617 overheard them, =93and I can't explain why I happened to speak then.
618 This is a nice scrape you've got me into, isn't it?=94
619
620 =93As for that, we are in the same scrape ourselves,=94 answered Dorothy,
621 cheerfully. =93But never mind; something will happen pretty soon.=94
622
623 =93Of course,=94 growled the horse, =93and then we shall be sorry it
624 happened.=94
625
626 Zeb gave a shiver. All this was so terrible and unreal that he could
627 not understand it at all, and so had good reason to be afraid.
628
629 Swiftly they drew near to the flaming colored suns, and passed close
630 beside them. The light was then so bright that it dazzled their eyes,
631 and they covered their faces with their hands to escape being blinded.
632 There was no heat in the colored suns, however, and after they had
633 passed below them the top of the buggy shut out many of the piercing
634 rays so that the boy and girl could open their eyes again.
635
636 =93We've got to come to the bottom some time,=94 remarked Zeb, with a deep
637 sigh. =93We can't keep falling forever, you know.=94
638
639 =93Of course not,=94 said Dorothy. =93We are somewhere in the middle of t=
640 he
641 earth, and the chances are we'll reach the other side of it before
642 long. But it's a big hollow, isn't it?=94
643
644 =93Awful big!=94 answered the boy.
645
646 =93We're coming to something now,=94 announced the horse.
647
648 At this they both put their heads over the side of the buggy and looked
649 down. Yes; there was land below them; and not so very far away,
650 either. But they were floating very, very slowly--so slowly that it
651 could no longer be called a fall--and the children had ample time to
652 take heart and look about them.
653
654 They saw a landscape with mountains and plains, lakes and rivers, very
655 like those upon the earth's surface; but all the scene was splendidly
656 colored by the variegated lights from the six suns. Here and there
657 were groups of houses that seemed made of clear glass, because they
658 sparkled so brightly.
659
660 =93I'm sure we are in no danger,=94 said Dorothy, in a sober voice. =93We
661 are falling so slowly that we can't be dashed to pieces when we land,
662 and this country that we are coming to seems quite pretty.=94
663
664 =93We'll never get home again, though!=94 declared Zeb, with a groan.
665
666 =93Oh, I'm not so sure of that,=94 replied the girl. =93But don't let us
667 worry over such things, Zeb; we can't help ourselves just now, you
668 know, and I've always been told it's foolish to borrow trouble.=94
669
670 The boy became silent, having no reply to so sensible a speech, and
671 soon both were fully occupied in staring at the strange scenes spread
672 out below them. They seemed to be falling right into the middle of a
673 big city which had many tall buildings with glass domes and
674 sharp-pointed spires. These spires were like great spear-points, and
675 if they tumbled upon one of them they were likely to suffer serious
676 injury.
677
678 Jim the horse had seen these spires, also, and his ears stood straight
679 up with fear, while Dorothy and Zeb held their breaths in suspense.
680 But no; they floated gently down upon a broad, flat roof, and came to a
681 stop at last.
682
683 When Jim felt something firm under his feet the poor beast's legs
684 trembled so much that he could hardly stand; but Zeb at once leaped out
685 of the buggy to the roof, and he was so awkward and hasty that he
686 kicked over Dorothy's bird-cage, which rolled out upon the roof so that
687 the bottom came off. At once a pink kitten crept out of the upset
688 cage, sat down upon the glass roof, and yawned and blinked its round
689 eyes.
690
691 =93Oh,=94 said Dorothy. =93There's Eureka.=94
692
693 =93First time I ever saw a pink cat,=94 said Zeb.
694
695 =93Eureka isn't pink; she's white. It's this queer light that gives her
696 that color.=94
697
698 =93Where's my milk?=94 asked the kitten, looking up into Dorothy's face.
699 =93I'm 'most starved to death.=94
700
701 =93Oh, Eureka! Can you talk?=94
702
703 =93Talk! Am I talking? Good gracious, I believe I am. Isn't it funny?=94
704 asked the kitten.
705
706 =93It's all wrong,=94 said Zeb, gravely. =93Animals ought not to talk. B=
707 ut
708 even old Jim has been saying things since we had our accident.=94
709
710 =93I can't see that it's wrong,=94 remarked Jim, in his gruff tones. =93A=
711 t
712 least, it isn't as wrong as some other things. What's going to become
713 of us now?=94
714
715 =93I don't know,=94 answered the boy, looking around him curiously.
716
717 The houses of the city were all made of glass, so clear and transparent
718 that one could look through the walls as easily as through a window.
719 Dorothy saw, underneath the roof on which she stood, several rooms used
720 for rest chambers, and even thought she could make out a number of
721 queer forms huddled into the corners of these rooms.
722
723 The roof beside them had a great hole smashed through it, and pieces of
724 glass were lying scattered in every direction. A nearby steeple had
725 been broken off short and the fragments lay heaped beside it. Other
726 buildings were cracked in places or had corners chipped off from them;
727 but they must have been very beautiful before these accidents had
728 happened to mar their perfection. The rainbow tints from the colored
729 suns fell upon the glass city softly and gave to the buildings many
730 delicate, shifting hues which were very pretty to see.
731
732 But not a sound had broken the stillness since the strangers had
733 arrived, except that of their own voices. They began to wonder if
734 there were no people to inhabit this magnificent city of the inner
735 world.
736
737 Suddenly a man appeared through a hole in the roof next to the one they
738 were on and stepped into plain view. He was not a very large man, but
739 was well formed and had a beautiful face--calm and serene as the face
740 of a fine portrait. His clothing fitted his form snugly and was
741 gorgeously colored in brilliant shades of green, which varied as the
742 sunbeams touched them but was not wholly influenced by the solar rays.
743
744 The man had taken a step or two across the glass roof before he noticed
745 the presence of the strangers; but then he stopped abruptly. There was
746 no expression of either fear or surprise upon his tranquil face, yet he
747 must have been both astonished and afraid; for after his eyes had
748 rested upon the ungainly form of the horse for a moment he walked
749 rapidly to the furthest edge of the roof, his head turned back over his
750 shoulder to gaze at the strange animal.
751
752 =93Look out!=94 cried Dorothy, who noticed that the beautiful man did not
753 look where he was going; =93be careful, or you'll fall off!=94
754
755 But he paid no attention to her warning. He reached the edge of the
756 tall roof, stepped one foot out into the air, and walked into space as
757 calmly as if he were on firm ground.
758
759 The girl, greatly astonished, ran to lean over the edge of the roof,
760 and saw the man walking rapidly through the air toward the ground.
761 Soon he reached the street and disappeared through a glass doorway into
762 one of the glass buildings.
763
764 =93How strange!=94 she exclaimed, drawing a long breath.
765 EOF
766
767 cat >"$expected" <<EOF
768 [ Message inbox:$msgnum ]
769 Date: Sun, 18 Dec 2005 00:52:39 +0100
770 To: bar@example.edu
771 From: foo@example.edu
772 Subject: check charset conversion of a large file
773
774 MIME-Version: 1.0
775
776 [ part - text/plain - 18.9KB ]
777 1. The Earthquake
778
779
780 The train from 'Frisco was very late. It should have arrived at
781 Hugson's Siding at midnight, but it was already five o'clock and the
782 gray dawn was breaking in the east when the little train slowly rumbled
783 up to the open shed that served for the station-house. As it came to a
784 stop the conductor called out in a loud voice:
785
786 “Hugson's Siding!”
787
788 At once a little girl rose from her seat and walked to the door of the
789 car, carrying a wicker suit-case in one hand and a round bird-cage
790 covered up with newspapers in the other, while a parasol was tucked
791 under her arm. The conductor helped her off the car and then the
792 engineer started his train again, so that it puffed and groaned and
793 moved slowly away up the track. The reason he was so late was because
794 all through the night there were times when the solid earth shook and
795 trembled under him, and the engineer was afraid that at any moment the
796 rails might spread apart and an accident happen to his passengers. So
797 he moved the cars slowly and with caution.
798
799 The little girl stood still to watch until the train had disappeared
800 around a curve; then she turned to see where she was.
801
802 The shed at Hugson's Siding was bare save for an old wooden bench, and
803 did not look very inviting. As she peered through the soft gray light
804 not a house of any sort was visible near the station, nor was any
805 person in sight; but after a while the child discovered a horse and
806 buggy standing near a group of trees a short distance away. She walked
807 toward it and found the horse tied to a tree and standing motionless,
808 with its head hanging down almost to the ground. It was a big horse,
809 tall and bony, with long legs and large knees and feet. She could
810 count his ribs easily where they showed through the skin of his body,
811 and his head was long and seemed altogether too big for him, as if it
812 did not fit. His tail was short and scraggly, and his harness had been
813 broken in many places and fastened together again with cords and bits
814 of wire. The buggy seemed almost new, for it had a shiny top and side
815 curtains. Getting around in front, so that she could look inside, the
816 girl saw a boy curled up on the seat, fast asleep.
817
818 She set down the bird-cage and poked the boy with her parasol.
819 Presently he woke up, rose to a sitting position and rubbed his eyes
820 briskly.
821
822 “Hello!” he said, seeing her, “are you Dorothy Gale?”
823
824 “Yes,” she answered, looking gravely at his tousled hair and blinking
825 gray eyes. “Have you come to take me to Hugson's Ranch?”
826
827 “Of course,” he answered. “Train in?”
828
829 “I couldn't be here if it wasn't,” she said.
830
831 He laughed at that, and his laugh was merry and frank. Jumping out of
832 the buggy he put Dorothy's suit-case under the seat and her bird-cage
833 on the floor in front.
834
835 “Canary-birds?” he asked.
836
837 “Oh no; it's just Eureka, my kitten. I thought that was the best way
838 to carry her.”
839
840 The boy nodded.
841
842 “Eureka's a funny name for a cat,” he remarked.
843
844 “I named my kitten that because I found it,” she explained. “Uncle
845 Henry says 'Eureka' means 'I have found it.'”
846
847 “All right; hop in.”
848
849 She climbed into the buggy and he followed her. Then the boy picked up
850 the reins, shook them, and said “Gid-dap!”
851
852 The horse did not stir. Dorothy thought he just wiggled one of his
853 drooping ears, but that was all.
854
855 “Gid-dap!” called the boy, again.
856
857 The horse stood still.
858
859 “Perhaps,” said Dorothy, “if you untied him, he would go.”
860
861 The boy laughed cheerfully and jumped out.
862
863 “Guess I'm half asleep yet,” he said, untying the horse. “But Jim
864 knows his business all right--don't you, Jim?” patting the long nose of
865 the animal.
866
867 Then he got into the buggy again and took the reins, and the horse at
868 once backed away from the tree, turned slowly around, and began to trot
869 down the sandy road which was just visible in the dim light.
870
871 “Thought that train would never come,” observed the boy. “I've waited
872 at that station for five hours.”
873
874 “We had a lot of earthquakes,” said Dorothy. “Didn't you feel the
875 ground shake?”
876
877 “Yes; but we're used to such things in California,” he replied. “They
878 don't scare us much.”
879
880 “The conductor said it was the worst quake he ever knew.”
881
882 “Did he? Then it must have happened while I was asleep,” he said
883 thoughtfully.
884
885 “How is Uncle Henry?” she enquired, after a pause during which the
886 horse continued to trot with long, regular strides.
887
888 “He's pretty well. He and Uncle Hugson have been having a fine visit.”
889
890 “Is Mr. Hugson your uncle?” she asked.
891
892 “Yes. Uncle Bill Hugson married your Uncle Henry's wife's sister; so
893 we must be second cousins,” said the boy, in an amused tone. “I work
894 for Uncle Bill on his ranch, and he pays me six dollars a month and my
895 board.”
896
897 “Isn't that a great deal?” she asked, doubtfully.
898
899 “Why, it's a great deal for Uncle Hugson, but not for me. I'm a
900 splendid worker. I work as well as I sleep,” he added, with a laugh.
901
902 “What is your name?” said Dorothy, thinking she liked the boy's manner
903 and the cheery tone of his voice.
904
905 “Not a very pretty one,” he answered, as if a little ashamed. “My
906 whole name is Zebediah; but folks just call me 'Zeb.' You've been to
907 Australia, haven't you?”
908
909 “Yes; with Uncle Henry,” she answered. “We got to San Francisco a week
910 ago, and Uncle Henry went right on to Hugson's Ranch for a visit while
911 I stayed a few days in the city with some friends we had met.”
912
913 “How long will you be with us?” he asked.
914
915 “Only a day. Tomorrow Uncle Henry and I must start back for Kansas.
916 We've been away for a long time, you know, and so we're anxious to get
917 home again.”
918
919 The boy flicked the big, boney horse with his whip and looked
920 thoughtful. Then he started to say something to his little companion,
921 but before he could speak the buggy began to sway dangerously from side
922 to side and the earth seemed to rise up before them. Next minute there
923 was a roar and a sharp crash, and at her side Dorothy saw the ground
924 open in a wide crack and then come together again.
925
926 “Goodness!” she cried, grasping the iron rail of the seat. “What was
927 that?”
928
929 “That was an awful big quake,” replied Zeb, with a white face. “It
930 almost got us that time, Dorothy.”
931
932 The horse had stopped short, and stood firm as a rock. Zeb shook the
933 reins and urged him to go, but Jim was stubborn. Then the boy cracked
934 his whip and touched the animal's flanks with it, and after a low moan
935 of protest Jim stepped slowly along the road.
936
937 Neither the boy nor the girl spoke again for some minutes. There was a
938 breath of danger in the very air, and every few moments the earth would
939 shake violently. Jim's ears were standing erect upon his head and
940 every muscle of his big body was tense as he trotted toward home. He
941 was not going very fast, but on his flanks specks of foam began to
942 appear and at times he would tremble like a leaf.
943
944 The sky had grown darker again and the wind made queer sobbing sounds
945 as it swept over the valley.
946
947 Suddenly there was a rending, tearing sound, and the earth split into
948 another great crack just beneath the spot where the horse was standing.
949 With a wild neigh of terror the animal fell bodily into the pit,
950 drawing the buggy and its occupants after him.
951
952 Dorothy grabbed fast hold of the buggy top and the boy did the same.
953 The sudden rush into space confused them so that they could not think.
954
955 Blackness engulfed them on every side, and in breathless silence they
956 waited for the fall to end and crush them against jagged rocks or for
957 the earth to close in on them again and bury them forever in its
958 dreadful depths.
959
960 The horrible sensation of falling, the darkness and the terrifying
961 noises, proved more than Dorothy could endure and for a few moments the
962 little girl lost consciousness. Zeb, being a boy, did not faint, but
963 he was badly frightened, and clung to the buggy seat with a tight grip,
964 expecting every moment would be his last.
965
966
967
968
969 2. The Glass City
970
971
972 When Dorothy recovered her senses they were still falling, but not so
973 fast. The top of the buggy caught the air like a parachute or an
974 umbrella filled with wind, and held them back so that they floated
975 downward with a gentle motion that was not so very disagreeable to
976 bear. The worst thing was their terror of reaching the bottom of this
977 great crack in the earth, and the natural fear that sudden death was
978 about to overtake them at any moment. Crash after crash echoed far
979 above their heads, as the earth came together where it had split, and
980 stones and chunks of clay rattled around them on every side. These
981 they could not see, but they could feel them pelting the buggy top, and
982 Jim screamed almost like a human being when a stone overtook him and
983 struck his boney body. They did not really hurt the poor horse,
984 because everything was falling together; only the stones and rubbish
985 fell faster than the horse and buggy, which were held back by the
986 pressure of the air, so that the terrified animal was actually more
987 frightened than he was injured.
988
989 How long this state of things continued Dorothy could not even guess,
990 she was so greatly bewildered. But bye and bye, as she stared ahead
991 into the black chasm with a beating heart, she began to dimly see the
992 form of the horse Jim--his head up in the air, his ears erect and his
993 long legs sprawling in every direction as he tumbled through space.
994 Also, turning her head, she found that she could see the boy beside
995 her, who had until now remained as still and silent as she herself.
996
997 Dorothy sighed and commenced to breathe easier. She began to realize
998 that death was not in store for her, after all, but that she had merely
999 started upon another adventure, which promised to be just as queer and
1000 unusual as were those she had before encountered.
1001
1002 With this thought in mind the girl took heart and leaned her head over
1003 the side of the buggy to see where the strange light was coming from.
1004 Far below her she found six great glowing balls suspended in the air.
1005 The central and largest one was white, and reminded her of the sun.
1006 Around it were arranged, like the five points of a star, the other five
1007 brilliant balls; one being rose colored, one violet, one yellow, one
1008 blue and one orange. This splendid group of colored suns sent rays
1009 darting in every direction, and as the horse and buggy--with Dorothy
1010 and Zeb--sank steadily downward and came nearer to the lights, the rays
1011 began to take on all the delicate tintings of a rainbow, growing more
1012 and more distinct every moment until all the space was brilliantly
1013 illuminated.
1014
1015 Dorothy was too dazed to say much, but she watched one of Jim's big
1016 ears turn to violet and the other to rose, and wondered that his tail
1017 should be yellow and his body striped with blue and orange like the
1018 stripes of a zebra. Then she looked at Zeb, whose face was blue and
1019 whose hair was pink, and gave a little laugh that sounded a bit nervous.
1020
1021 “Isn't it funny?” she said.
1022
1023 The boy was startled and his eyes were big. Dorothy had a green streak
1024 through the center of her face where the blue and yellow lights came
1025 together, and her appearance seemed to add to his fright.
1026
1027 “I--I don't s-s-see any-thing funny--'bout it!” he stammered.
1028
1029 Just then the buggy tipped slowly over upon its side, the body of the
1030 horse tipping also. But they continued to fall, all together, and the
1031 boy and girl had no difficulty in remaining upon the seat, just as they
1032 were before. Then they turned bottom side up, and continued to roll
1033 slowly over until they were right side up again. During this time Jim
1034 struggled frantically, all his legs kicking the air; but on finding
1035 himself in his former position the horse said, in a relieved tone of
1036 voice:
1037
1038 “Well, that's better!”
1039
1040 Dorothy and Zeb looked at one another in wonder.
1041
1042 “Can your horse talk?” she asked.
1043
1044 “Never knew him to, before,” replied the boy.
1045
1046 “Those were the first words I ever said,” called out the horse, who had
1047 overheard them, “and I can't explain why I happened to speak then.
1048 This is a nice scrape you've got me into, isn't it?”
1049
1050 “As for that, we are in the same scrape ourselves,” answered Dorothy,
1051 cheerfully. “But never mind; something will happen pretty soon.”
1052
1053 “Of course,” growled the horse, “and then we shall be sorry it
1054 happened.”
1055
1056 Zeb gave a shiver. All this was so terrible and unreal that he could
1057 not understand it at all, and so had good reason to be afraid.
1058
1059 Swiftly they drew near to the flaming colored suns, and passed close
1060 beside them. The light was then so bright that it dazzled their eyes,
1061 and they covered their faces with their hands to escape being blinded.
1062 There was no heat in the colored suns, however, and after they had
1063 passed below them the top of the buggy shut out many of the piercing
1064 rays so that the boy and girl could open their eyes again.
1065
1066 “We've got to come to the bottom some time,” remarked Zeb, with a deep
1067 sigh. “We can't keep falling forever, you know.”
1068
1069 “Of course not,” said Dorothy. “We are somewhere in the middle of the
1070 earth, and the chances are we'll reach the other side of it before
1071 long. But it's a big hollow, isn't it?”
1072
1073 “Awful big!” answered the boy.
1074
1075 “We're coming to something now,” announced the horse.
1076
1077 At this they both put their heads over the side of the buggy and looked
1078 down. Yes; there was land below them; and not so very far away,
1079 either. But they were floating very, very slowly--so slowly that it
1080 could no longer be called a fall--and the children had ample time to
1081 take heart and look about them.
1082
1083 They saw a landscape with mountains and plains, lakes and rivers, very
1084 like those upon the earth's surface; but all the scene was splendidly
1085 colored by the variegated lights from the six suns. Here and there
1086 were groups of houses that seemed made of clear glass, because they
1087 sparkled so brightly.
1088
1089 “I'm sure we are in no danger,” said Dorothy, in a sober voice. “We
1090 are falling so slowly that we can't be dashed to pieces when we land,
1091 and this country that we are coming to seems quite pretty.”
1092
1093 “We'll never get home again, though!” declared Zeb, with a groan.
1094
1095 “Oh, I'm not so sure of that,” replied the girl. “But don't let us
1096 worry over such things, Zeb; we can't help ourselves just now, you
1097 know, and I've always been told it's foolish to borrow trouble.”
1098
1099 The boy became silent, having no reply to so sensible a speech, and
1100 soon both were fully occupied in staring at the strange scenes spread
1101 out below them. They seemed to be falling right into the middle of a
1102 big city which had many tall buildings with glass domes and
1103 sharp-pointed spires. These spires were like great spear-points, and
1104 if they tumbled upon one of them they were likely to suffer serious
1105 injury.
1106
1107 Jim the horse had seen these spires, also, and his ears stood straight
1108 up with fear, while Dorothy and Zeb held their breaths in suspense.
1109 But no; they floated gently down upon a broad, flat roof, and came to a
1110 stop at last.
1111
1112 When Jim felt something firm under his feet the poor beast's legs
1113 trembled so much that he could hardly stand; but Zeb at once leaped out
1114 of the buggy to the roof, and he was so awkward and hasty that he
1115 kicked over Dorothy's bird-cage, which rolled out upon the roof so that
1116 the bottom came off. At once a pink kitten crept out of the upset
1117 cage, sat down upon the glass roof, and yawned and blinked its round
1118 eyes.
1119
1120 “Oh,” said Dorothy. “There's Eureka.”
1121
1122 “First time I ever saw a pink cat,” said Zeb.
1123
1124 “Eureka isn't pink; she's white. It's this queer light that gives her
1125 that color.”
1126
1127 “Where's my milk?” asked the kitten, looking up into Dorothy's face.
1128 “I'm 'most starved to death.”
1129
1130 “Oh, Eureka! Can you talk?”
1131
1132 “Talk! Am I talking? Good gracious, I believe I am. Isn't it funny?”
1133 asked the kitten.
1134
1135 “It's all wrong,” said Zeb, gravely. “Animals ought not to talk. But
1136 even old Jim has been saying things since we had our accident.”
1137
1138 “I can't see that it's wrong,” remarked Jim, in his gruff tones. “At
1139 least, it isn't as wrong as some other things. What's going to become
1140 of us now?”
1141
1142 “I don't know,” answered the boy, looking around him curiously.
1143
1144 The houses of the city were all made of glass, so clear and transparent
1145 that one could look through the walls as easily as through a window.
1146 Dorothy saw, underneath the roof on which she stood, several rooms used
1147 for rest chambers, and even thought she could make out a number of
1148 queer forms huddled into the corners of these rooms.
1149
1150 The roof beside them had a great hole smashed through it, and pieces of
1151 glass were lying scattered in every direction. A nearby steeple had
1152 been broken off short and the fragments lay heaped beside it. Other
1153 buildings were cracked in places or had corners chipped off from them;
1154 but they must have been very beautiful before these accidents had
1155 happened to mar their perfection. The rainbow tints from the colored
1156 suns fell upon the glass city softly and gave to the buildings many
1157 delicate, shifting hues which were very pretty to see.
1158
1159 But not a sound had broken the stillness since the strangers had
1160 arrived, except that of their own voices. They began to wonder if
1161 there were no people to inhabit this magnificent city of the inner
1162 world.
1163
1164 Suddenly a man appeared through a hole in the roof next to the one they
1165 were on and stepped into plain view. He was not a very large man, but
1166 was well formed and had a beautiful face--calm and serene as the face
1167 of a fine portrait. His clothing fitted his form snugly and was
1168 gorgeously colored in brilliant shades of green, which varied as the
1169 sunbeams touched them but was not wholly influenced by the solar rays.
1170
1171 The man had taken a step or two across the glass roof before he noticed
1172 the presence of the strangers; but then he stopped abruptly. There was
1173 no expression of either fear or surprise upon his tranquil face, yet he
1174 must have been both astonished and afraid; for after his eyes had
1175 rested upon the ungainly form of the horse for a moment he walked
1176 rapidly to the furthest edge of the roof, his head turned back over his
1177 shoulder to gaze at the strange animal.
1178
1179 “Look out!” cried Dorothy, who noticed that the beautiful man did not
1180 look where he was going; “be careful, or you'll fall off!”
1181
1182 But he paid no attention to her warning. He reached the edge of the
1183 tall roof, stepped one foot out into the air, and walked into space as
1184 calmly as if he were on firm ground.
1185
1186 The girl, greatly astonished, ran to lean over the edge of the roof,
1187 and saw the man walking rapidly through the air toward the ground.
1188 Soon he reached the street and disappeared through a glass doorway into
1189 one of the glass buildings.
1190
1191 “How strange!” she exclaimed, drawing a long breath.
1192 EOF
1193
1194 run_prog mhshow last >"$actual" 2>&1
1195 check "$expected" "$actual" : large file conversion to UTF-8
1196
1197 exit $failed