CharsetUser Manual

charset(1)

Name

charset — Character set encoding

Synopsis

charset 

-c charset [ -d ] [ -e ] text

charset 

{ -h | -v }

Description

A command-line interface to the character set encoding facility. This interface is provided as a convenience for debugging purposes; it is limited to string input only.

The character set mapping recodes arbitrary byte-ranged input down to the specific subset of characters permitted. This produces output which is longer, but only uses explicitly-permitted values; this is particularly useful for tunneling over protocols which do not permit certain characters (for example, newlines in a HTTP header).

Encoding and decoding are specified by -e and -d respectively. The default is to both encode and decode.

Options

-c charset

Specify a character set. A character set must be specified.

-d

Select decoding from the specified character set.

-e

Select encoding to the specified character set.

Exit Status

Exits >0 if an error occurs, or 0 on success.

Examples

For example, encoding and decoding the string “Hello” to the character set { 'a', 'b', 'c', 'd' }:

% charset -e -c abcd Hello
acabbbcbadcbadcbddcb
% charset -d -c abcd acabbbcbadcbadcbddcb
Hello
%

Using a character set of { '0', '1' } is equivalent to producing a byte-by-byte representation in binary:

% charset -e -c 01 A
10000010

A character set of all 256 values permitted by an eight-bit-byte would be equivalent to the identity function, however this CLI tool is limited to strings only.

See Also

charset_encode.

History

charset was designed and implemented by Katherine Flavel for Bubblephone Ltd.