File: hztty.1

package info (click to toggle)
hztty 2.0-5.2woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,028 kB
  • ctags: 295
  • sloc: ansic: 26,960; makefile: 162; sh: 109
file content (178 lines) | stat: -rw-r--r-- 5,368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.TH HZTTY 1 "29 January 1995"
.SH NAME
hztty \- make a tty session understand different encodings
.SH SYNOPSIS
.B hztty
[
.B \-h
] [
.B \-I
.I input-stream
] [
.B \-O
.I output-stream
]
[command line]
.SH DESCRIPTION
.B hztty
translates Chinese codes on your terminal from some \fIforeign\fP
encoding or representation standard to the \fInative\fP encoding
understandable by your terminal.
A \fInative\fP encoding is the standard used by your terminal session,
for example ``GB'' on ``cxterm'', ``Big5'' on ``cxterm -BIG5'' or ET Dos.
A \fIforeign\fP encoding is the one used by application running
on the terminal, for example, the ``zW/HZ'' representation,
the standard ``Unicode'', the ASCII-compatible ``UTF8'',
the mail-safe ``UTF7'', etc.
.B hztty
also translates Chinese codes you input on your terminal from
the native encoding to the foreign encoding used by the application.
.LP
.B hztty
was initially designed to read/post articles in the newsgroup
``alt.chinese.text'', in which the ``zW/HZ'' scheme is used to
represent Chinese characters.
Now it can do much more than that.
.LP
.B hztty
ends when the forked shell exits.
.SH IO STREAMS
.LP
The Chinese code conversion in hztty is organized using the
.I stream
mechanism.
A stream consists of one or more conversion modules.
Each of these modules implements a different kind of code conversion.
In a stream the conversion modules form a pipeline that 
feeds one module's output to the next module's input.
There is an input stream (from terminal input to the application)
and an output stream (from the application to the terminal screen)
in hztty.
This version of hztty implements the following conversion modules.
.TP
.B hz2gb
It converts zW/HZ to GB, usually used in output stream.
.TP
.B gb2hz
It converts GB to zW/HZ, usually used in input stream.
Note that you have to type in the escape sequences
yourself and make the text conforms to HZ specification.
Hztty enforces no encoding policy.
.TP
.B gb2big
It converts GB to Big5.
.TP
.B big2gb
It converts Big5 to GB.
.TP
.B uni-utf
It converts 16bit Unicode to 8-bit UTF format.
.TP
.B utf-uni
It converts 8-bit UTF format to 16bit Unicode.
.TP
.B uni-utf7
It converts 16bit Unicode to 7-bit mail-safe UTF format (RFC1642).
.TP
.B utf7-uni
It converts the 7-bit mail-safe UTF format to 16bit Unicode.
.TP
.B gb2uni
It converts GB to 16bit Unicode.
.TP
.B uni2gb
It converts 16bit Unicode to GB.
.TP
.B big2uni
It converts Big5 to 16bit Unicode.
.TP
.B uni2big
It converts 16bit Unicode to Big5.
.TP
.B toascii
.B toupper
.B tolower
They converts ASCII as those of ctype(3).
.TP
.B dummy
It does no conversion, bindly copying
from the previous module to the next module.
.TP
.B log(\fIfilename\fB)
It does no conversion but saves a copy of every characters
that passes through this module in a log file named \fIfilename\fP.
Be aware that the log file grows very fast
since everything you type and all program output are saved.
.SH OPTIONS
.TP
.B \-h
prints the help message and lists all the module implemented.
.TP
.B \-I
specifies the input stream.
If there are more than one modules in the stream,
the module names are separated by `:'.
The default input stream is ``gb2hz''.
.TP
.B \-O
specifies the output stream.
If there are more than one modules in the stream,
the module names are seperated by `:'.
The default output stream is ``hz2gb''.
.LP
If \fIcommand line\fP is not given, the user selected shell
(from the environment variable SHELL) is invoked in the hztty session.
Otherwise, the \fIcommand line\fP is invoked instead of the shell.
.SH EXAMPLES
Examples of conversion module combination in IO streams:
.TP
.B hztty
It implies the default input/output streams of \fB-O hz2gb -I gb2hz\fP.
It is useful in reading and writing HZ style Chinese codes
(as in the newsgroup ``alt.chinese.text'').
.TP
.B hztty -O hz2gb:gb2big -I big2gb:gb2hz
converts between HZ and Big5.
In the output stream, HZ output are converted to GB first, then to Big5.
In the input stream, Big5 input are converted to GB first, then to HZ.
Useful in reading ``alt.chinese.text'' in a Big5 cxterm
or other terminal emulator (e.g., kermit over IBM-PC running ET DOS). 
.TP
.B hztty -O utf-uni:uni2gb -I gb2uni:uni-utf
converts UTF output into GB in the output stream
and GB into UTF in the input stream.
.SH SEE ALSO
HZ - A Data Format for Exchanging Files of
.br
Arbitrarily Mixed Chinese and ASCII characters
.LP
More on Unicode in ftp://unicode.org/pub/
.SH AUTHOR
.LP
Yongguang Zhang
.I (ygz@cs.purdue.edu)
.LP
Copyright @ 1992, 1995 by Yongguang Zhang
.br
Permission to use, copy, modify, and redistribute is hereby granted.
The author disclaims all warranties with regarding to this software.
.SH CONTRIBUTORS AND ACKNOWLEDGEMENTS
.LP
Norm Matloff, University of California at Davis,
.I (matloff@cs.ucdavis.edu),
contributes his code for reading zW/HZ in a Big5 cxterm on the fly.
.LP
The Big5/GB conversion tables are generated from HC 1.2u,
by Feng Feng Lee of Stanford University and
Ricky Yeung of Washington University (now with Sun Microsystems).
.LP
The Unicode conversion tables are generated from Ross Paterson's
utf7 package.
.I (<rap@doc.ic.ac.uk>)
.LP
Shangjie Jin of Edinburgh University, UK,
.I (sjin@castle.edinburgh.ac.uk),
ported hztty to sequent boxes.
.SH BUGS
.LP
Cannot dynamically add (delete) a conversion module to (from) the streams.