Home - Resumé - Up


Name

char - convert numbers to characters

Synopsis

char [−1befnowxBLMW] [−r radix] [source ...]

Description

Char converts numbers to the corresponding characters.

The options are as follows:

−1
Interpret at most one number per line. (This flag is the digit 1.)

−b
Numbers are binary (radix 2).

−e
This flag changes char’s output format. Normally it prints only the characters specified, and optionally a trailing newline. Under the −e flag, char writes a line for each input number, consisting of the number, a tab, and the corresponding character.

−f
Normally, char treats each source argument as a number and prints the corresponding character. Under the −f flag, char instead takes the source arguments to be file names, and converts every identifiable number in each file.

If no source arguments are supplied, add reads the standard input, with or without −f.

−n
Do not print a newline after the characters.

−o
Numbers are octal (radix 8).

−r radix
Sets the radix (base) for numbers. In the absence of any radix flag, or if radix is zero, then numbers are C-style integers with a optional 0x or 0 prefix.

−w
Print two-byte wide characters.

−x
Numbers are hexadecimal (radix 16).

−B
Print wide characters in big-endian form. If wide characters are selected and neither −B nor −L is specified, then char uses the host’s native byte order. If neither −w nor −W is specified, char assumes −w.

−L
Print wide characters in little-endian form. If wide characters are selected and neither −B nor −L is specified, then char uses the host’s native byte order. If neither −w nor −W is specified, char assumes −w.

−M
Preface wide character output with a byte-order mark, 0xFEFF. If neither −w nor −W is specified, char assumes −w.

−W
Print four-byte wide characters.

See Also

strtoul(3) , ascii(7)