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