bidiv(1) | Ivrix | bidiv(1) |
bidiv - bidirectional text filter
bidiv [ -plj ] [ -w width ] [file...]
bidiv is a filter, or viewer, for birectional text stored in logical-order. It converts such text into visual-order text which can be viewed on terminals that do not handle bidirectionality. The output visual-order text is formatted assuming a fixed number of characters per line (automatically determined or given with the -w parameter).
bidiv is oriented towards Hebrew, and assumes the input to be a Hebrew and ASCII text encoded in one of the two common logical-order encodings: ISO-8859-8-i or UTF-8. Actually, bidiv guesses the encoding of its input at a character by character basis, so the input might be a mix of ISO-8859-8-i and Hebrew UTF-8. bidiv's output is visual-order text, in either the ISO-8859-8 or UTF-8 encoding, depending on your locale setting.
bidiv reads each file in sequence, converts it into visual order and writes it on the standard output. Thus:
prints file on your terminal (assuming it has the appropriate fonts, but no bidirectionality support), and:
concatenates file1 and file2, and shows the results using the pager less.
If no input file is given, bidiv reads from the standard input file.
For more ideas on how to use bidiv, see the EXAMPLES section below.
The -p option tells bidiv to choose a base direction per paragraph, where a paragraph is delimited by an empty line. This is bidiv's default behavior, and usually gives the expected results on most texts and emails.
The direction of the entire paragraph is chosen according to the first strongly-directioned character (i.e., an alphabetic character) appearing in the paragraph. Currently, if the first output line of a paragraph has no directional characters (e.g., a line of minus signs before an email signature, or a line containing only numbers) that line is output with the same direction of the previous paragraph, but it does not determine the direction of the rest of the paragraph. If the first line of the first paragraph does not have a direction, the RTL direction is arbitrarily chosen.
When the -w option is not given, bidiv uses the value of the COLUMNS variable, which is usually automatically defined by the user's shell. When that both the -w option and the COLUMNS variable are missing, the default of 80 columns is used.
The following operand is supported:
(or groff -man -Tlatin1 something.1 |sed 's/.^H\(.\)/\1/g' |../bidiv -w 65)
COLUMNS see -w option.
The following exit values are returned:
Written by Nadav Har'El, http://nadav.harel.org.il.
Please send bug reports and comments to nyh@math.technion.ac.il.
The latest version of this software can be found in ftp://ftp.ivrix.org.il/pub/ivrix/src/cmdline
cat(1), fribidi(3)
7 Jan 2006 | Bidiv |