1
--- maradns-1.2.12.03/tools/ej/ej2man 2006-06-21 03:59:30.000000000 -0500
2
+++ maradns-1.2.12.04/tools/ej/ej2man 2006-10-25 21:40:23.000000000 -0500
4
# Perl at /usr/local/bin/perl then anywhere else in the user's path.
8
# Convert an ej-formatted doc in to a man page
9
# Input: First argument or standard input
10
# Output: Standard output
12
-# Determine the version of Perl we are using
13
-$vers=sprintf("%vd",$^V);
14
-# 5.8.0 needs the following line
15
-if($vers =~ /5.8.0/) {
16
- print "Sorry, this verion of Perl is broken with Unicode characters\n";
19
+$FILENAME = shift || "/////";
21
# Tmp dir (used for running iconv on non-8859-1 pages)
22
$TMP = $ENV{'HOME'} . "/tmp";
27
-while(<>){$doc .= $_}
28
+# This makes the script happy when run with both Perl 5.8.0 and
29
+# Perl 5.8.8; basically 5.8.0 had a lot of unhappy Unicode bugs
30
+# and so they changed the behavior for later releases. It is possible
31
+# to make a Unicode-happy script that runs unchanged Unicode-happy
32
+# on both 5.8.0 and 5.8.8, but the contortions I had to do were
35
+# I would like to thank all of the helpful people in the newsgroup
36
+# comp.lang.perl.misc for their assistance; I couldn't have done it
40
+if($FILENAME ne "/////") {
42
+ open(STDIN,"< $FILENAME");
45
+binmode(STDIN,":utf8");
47
+while(<STDIN>){$doc .= $_}
49
#$* = 1; # Match multiple lines
52
$parts[$hack] =~ s/\'/\\\(aq/g;
53
# Handle the á character (Debian's lint complains if the
54
# man page has raw hi-bit characters)
55
- $parts[$hack] =~ s|á|\\\(\'a|g;
56
+ $parts[$hack] =~ s|\xc3\xa1|\\\(\'a|g;
57
$body .= $parts[$hack];