LinuxCommandLibrary

codepage

Display or set character code page

SYNOPSIS

codepage [-l] | [-s codepage] | [codepage]

PARAMETERS

-l
    List available codepages

-s
    Set active codepage (e.g., -s 437)

codepage
    Specify codepage number directly

DESCRIPTION

The codepage command is not a standard Linux utility found in major distributions like Ubuntu, Fedora, or Debian base systems. It appears in niche or legacy contexts, such as DOS emulation tools (e.g., DOSEMU), embedded systems, or custom packages for converting between DOS/Windows codepages (e.g., CP437, CP850) and Unicode.

If referenced, it typically manages character encoding mappings for console or file systems, similar to Windows' chcp. In Linux, equivalent functionality is provided by tools like iconv for conversion, loadkeys and setfont for console keyboard and font mappings, or locale for system encoding.

Without a standard manpage, usage varies by implementation. Common intent: display or set active codepage for text processing. Users seeking codepage support should install relevant packages (e.g., kbd for console tools) or use iconv -l to list encodings. Misuse may stem from cross-platform scripting confusion with Windows batch files.

CAVEATS

Not present in standard PATH or manpages; requires specific package installation. Behavior undefined across systems; prefer standard tools like iconv or loadkeys. Potential encoding errors if misused.

LINUX ALTERNATIVES

Use iconv -f CP1252 -t UTF-8 file.txt for conversions or loadkeys us.map.gz for console maps.
Check locale charmap for current encoding.

PACKAGE CHECK

Search with apt search codepage or yum search codepage; may appear in dosemu, cifs-utils, or custom repos.

HISTORY

Originated in DOS/Windows ecosystems (~1980s); Linux ports limited to emulation software like FreeDOS tools or custom utils in 1990s-2000s. Rarely maintained post-Unicode adoption (~2000s), supplanted by UTF-8 standards.

SEE ALSO

loadkeys(1), setfont(1), iconv(1), locale(1), dumpkeys(1)

Copied to clipboard