1bidiv(1)                             Ivrix                            bidiv(1)
2
3
4

NAME

6       bidiv - bidirectional text filter
7

SYNOPSIS

9       bidiv [ -plj ] [ -w width ] [file...]
10

DESCRIPTION

12       bidiv  is  a filter, or viewer, for birectional text stored in logical-
13       order. It converts such text into visual-order text which can be viewed
14       on  terminals  that  do not handle bidirectionality. The output visual-
15       order text is formatted assuming a fixed number of characters per  line
16       (automatically determined or given with the -w parameter).
17
18       bidiv  is oriented towards Hebrew, and assumes the input to be a Hebrew
19       and ASCII text encoded in one of the two  common  logical-order  encod‐
20       ings:  ISO-8859-8-i  or  UTF-8. Actually, bidiv guesses the encoding of
21       its input at a character by character basis, so the input  might  be  a
22       mix  of  ISO-8859-8-i and Hebrew UTF-8.  bidiv's output is visual-order
23       text, in either the ISO-8859-8 or UTF-8  encoding,  depending  on  your
24       locale setting.
25
26       bidiv  reads  each  file in sequence, converts it into visual order and
27       writes it on the standard output.  Thus:
28
29              $ bidiv file
30
31       prints file on your terminal (assuming it has  the  appropriate  fonts,
32       but no bidirectionality support), and:
33
34              $ bidiv file1 file2 | less
35
36       concatenates  file1  and  file2,  and shows the results using the pager
37       less.
38
39       If no input file is given, bidiv reads from the standard input file.
40
41       For more ideas on how to use bidiv, see the EXAMPLES section below.
42

OPTIONS

44       -p     Paragraph-based direction (default): When formatting a  bidirec‐
45              tional  output line, bidiv needs to be aware of that line's base
46              direction. A line whose base direction is RTL  (right  to  left)
47              gets right-justified and its first element appears on the right.
48              Otherwise, the line is  left-justified  and  its  first  element
49              appears on the left.
50
51              The  -p  option tells bidiv to choose a base direction per para‐
52              graph, where a paragraph is delimited by an empty line. This  is
53              bidiv's default behavior, and usually gives the expected results
54              on most texts and emails.
55
56              The direction of the entire paragraph is chosen according to the
57              first  strongly-directioned character (i.e., an alphabetic char‐
58              acter) appearing in the paragraph. Currently, if the first  out‐
59              put  line  of a paragraph has no directional characters (e.g., a
60              line of minus signs before an email signature, or  a  line  con‐
61              taining  only  numbers) that line is output with the same direc‐
62              tion of the previous paragraph, but it does  not  determine  the
63              direction of the rest of the paragraph. If the first line of the
64              first paragraph does not have a direction, the RTL direction  is
65              arbitrarily chosen.
66
67       -l     Line-based  direction:  This option choose an alternative method
68              of choosing each output line's base direction. When this  option
69              is enabled, the base direction of each output line is determined
70              on its own (again, according to the first character on the  line
71              with  a strong direction). This method may give wrong results in
72              the case where a line starts with a word of the opposite  direc‐
73              tion.  This  case  is  rare,  but does happen under random line-
74              splitting circumstances, or when the text is defining words of a
75              foreign language.
76
77
78       -j     Do not justify: By default, RTL lines are right-justified, i.e.,
79              they are padded with spaces on the left when  shorter  than  the
80              required  line  width  (see  the -w option). The -j option tells
81              bidiv not to preform this justifications, and leave short  lines
82              unpadded.
83
84       -w width
85              bidiv formats its output for lines of the given width. Lines are
86              split when longer than this width, and RTL lines are right-just‐
87              fied to fill that width unless the -j option is given.
88
89              When  the  -w  option  is not given, bidiv uses the value of the
90              COLUMNS variable, which is usually automatically defined by  the
91              user's  shell.   When  that  both  the -w option and the COLUMNS
92              variable are missing, the default of 80 columns is used.
93

OPERANDS

95       The following operand is supported:
96
97       file    A path name of an input file.  If no  file  is  specified,  the
98               standard input is used.
99
100

EXAMPLES

102       1. bidiv README | less
103
104       2. man something | bidiv | less
105
106          (or groff -man -Tlatin1 something.1 |sed 's/.^H\(.\)/\1/g' |../bidiv
107          -w 65)
108
109       3. set "bidiv" as a filter for your mail program (mutt, pine, etc.) for
110          viewing  mail  with the ISO 8859-8-i character set, and Hebrew UTF-8
111          mail.
112
113

ENVIRONMENT

115       COLUMNS see -w option.
116

EXIT STATUS

118       The following exit values are returned:
119
120       0   All input files were output successfully.
121
122       >0  An error occurred.
123

AUTHOR

125       Written by Nadav Har'El, http://nadav.harel.org.il.
126
127       Please send bug reports and comments to nyh@math.technion.ac.il.
128
129       The   latest   version   of   this   software   can   be    found    in
130       ftp://ftp.ivrix.org.il/pub/ivrix/src/cmdline
131

SEE ALSO

133       cat(1), fribidi(3)
134
135
136
137Bidiv                             7 Jan 2006                          bidiv(1)
Impressum