File: ascii.xml

package info (click to toggle)
ascii 3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 120 kB
  • sloc: ansic: 304; xml: 263; makefile: 36; sh: 17
file content (277 lines) | stat: -rw-r--r-- 8,790 bytes parent folder | download
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC 
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "docbook/docbookx.dtd">
<refentry id='ascii.1'>
<refmeta>
<refentrytitle>ascii</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class='date'>Aug 24 1994</refmiscinfo>
<refmiscinfo class='productname'>ascii</refmiscinfo>
<refmiscinfo class='source'>ascii</refmiscinfo>
<refmiscinfo class='manual'>Development Tools</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>ascii</refname>
<refpurpose>report character aliases</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>

<cmdsynopsis>
  <!-- ascii  [ \-dxohv ]   [ \-t ]   [ char\-alias ...  ]  -->
  <command>ascii</command>  <arg choice='opt'>-dxohv </arg>
  <arg choice='opt'>-t </arg>
  <arg choice='opt' rep='repeat'><replaceable>char-alias</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<refsect1 id='options'><title>OPTIONS</title>
<para>Called with no options, <command>ascii</command> behaves like
`ascii -h'.  Options are as follows:</para>
<variablelist remap='TP'>
<varlistentry>
<term>-t</term>
<listitem>
<para>Script-friendly mode, emits only ISO/decimal/hex/octal/binary
encodings of the character.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s</term>
<listitem>
<para>Parse multiple characters.  Convenient way of parsing strings.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-d</term>
<listitem>
<para>Ascii table in decimal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-x</term>
<listitem>
<para>Ascii table in hex.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-o</term>
<listitem>
<para>Ascii table in octal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h, -?</term>
<listitem>
<para>Show summary of options and a simple ASCII table.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v</term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
</variablelist>

</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>Characters in the ASCII set can have many aliases, depending on
context. A character's possible names include:</para>
<variablelist remap='TP'>
<varlistentry>
<term>*</term>
<listitem>
<para>Its bit pattern (binary representation).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its hex, decimal and octal representations.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its teletype mnemonic and caret-notation form (for control chars).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its backlash-escape form in C (for some control chars).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its printed form (for printables).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its full ISO official name in English.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its ISO/ECMA code table reference.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Its name as an HTML/SGML entity.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>*</term>
<listitem>
<para>Slang and other names in wide use for it among hackers.</para>
</listitem>
</varlistentry>
</variablelist>


<para>This utility accepts command-line strings and tries to interpret them as
one of the above.
When it finds a value, it prints <emphasis remap='I'>all</emphasis> of the names
of the character.
The constructs in the following list can be used to 
specify character values.
If an argument could be interpreted in two or more
ways, names for all the different characters it might be are dumped.</para>
<variablelist remap='TP'>
<varlistentry>
<term><emphasis remap='I'>character</emphasis></term>
<listitem>
<para>Any character not described by one of the following conventions
represents the character itself.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='B'>^</emphasis><emphasis remap='I'>character</emphasis></term>
<listitem>
<para>A caret followed by a character.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='B'>\</emphasis><emphasis remap='I'>character</emphasis></term>
<listitem>
<para>A backslash followed by certain special characters (abfnrtv).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>mnemonic</emphasis></term>
<listitem>
<para>An ASCII teletype mnemonic.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>hexadecimal</emphasis></term>
<listitem>
<para>A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit
characters (01234567890abcdef).
To ensure hex interpretation use
<emphasis remap='I'>hex</emphasis><emphasis remap='B'>h</emphasis><emphasis remap='I'>,</emphasis>
<emphasis remap='B'>0x</emphasis><emphasis remap='I'>hex,</emphasis>
<emphasis remap='B'>x</emphasis><emphasis remap='I'>hex</emphasis>
or
<emphasis remap='B'>\x</emphasis><emphasis remap='I'>hex.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>decimal</emphasis></term>
<listitem>
<para>A decimal sequence consists of one, two or three decimal digit
characters (0123456789).
To ensure decimal interpretation use
<emphasis remap='B'>\0d</emphasis><emphasis remap='I'>decimal,</emphasis>
<emphasis remap='B'>d</emphasis><emphasis remap='I'>decimal,</emphasis>
or
<emphasis remap='B'>\d</emphasis><emphasis remap='I'>decimal.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>octal</emphasis></term>
<listitem>
<para>An octal sequence consists of one, two or three octal digit
characters (01234567).
To ensure octal interpretation use
<emphasis remap='B'>\</emphasis><emphasis remap='I'>octal,</emphasis>
<emphasis remap='B'>0o</emphasis><emphasis remap='I'>octal,</emphasis>
<emphasis remap='B'>o</emphasis><emphasis remap='I'>octal,</emphasis>
or
<emphasis remap='B'>\o</emphasis><emphasis remap='I'>octal.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>bit pattern</emphasis></term>
<listitem>
<para>A bit pattern (binary) sequence consists of one to eight binary digit
characters (01).
To ensure bit interpretation use
<emphasis remap='B'>0b</emphasis><emphasis remap='I'>bit pattern,</emphasis>
<emphasis remap='B'>b</emphasis><emphasis remap='I'>bit pattern</emphasis>
or
<emphasis remap='B'>\b</emphasis><emphasis remap='I'>bit pattern.</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>ISO</emphasis>/<emphasis remap='I'>ECMA code</emphasis></term>
<listitem>
<para>A ISO/ECMA code sequence consists of one or two decimal digit characters,
a slash, and one or two decimal digit characters.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis remap='I'>name</emphasis></term>
<listitem>
<para>An official ASCII or slang name.</para>
</listitem>
</varlistentry>
</variablelist>

<para>The slang names recognized and printed out are from a rather
comprehensive list that first appeared on USENET in early 1990 and has
been continuously updated since.  Mnemonics recognized and printed
include the official ASCII set, some official ISO names (where those
differ) and a few common-use alternatives (such as NL for LF).
HTML/SGML entity names are also printed when applicable.  All
comparisons are case-insensitive, and dashes are mapped to spaces.
Any unrecognized arguments or out of range values are silently
ignored.  Note that the <option>-s</option> option will not recognize
'long' names, as it cannot differentiate them from other parts of the
string.</para>

<para>For correct results, be careful to stringize or quote shell
metacharacters in arguments (especially backslash).</para>

<para>This utility is particularly handy for interpreting cc(1)'s ugly
octal `invalid-character' messages, or when coding anything to do with serial
communications.
As a side effect it serves as a handy base-converter
for random 8-bit values.</para>
</refsect1>

<refsect1 id='author'><title>AUTHOR</title>

<para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>; November
1990 (home page at <ulink
url='http://www.catb.org/~esr/'>http://www.catb.org/~esr/</ulink>).
Reproduce, use, and modify as you like as long as you don't remove
this authorship notice.  Ioannis E. Tambouras
&lt;ioannis@debian.org&gt; added command options and minor
enhancements.  Brian J. Ginsbach &lt;ginsbach@sgi.com&gt; fixed
several bugs and expanded the man page.  David N. Welton
&lt;davidw@efn.org&gt; added the <option>-s</option> option.  Matej
Vela corrected the ISO names.  Dave Capella contributed the idea of
listing HTML/SGML entities.</para>
</refsect1>
</refentry>