Introduction
These are the documents saved by WordPerfect 4.2 for DOS (1986) and the versions
before it, from WordPerfect Corporation,
which led the word processor market on MS-DOS in the late 1980s. A document is a plain
stream: ASCII text with function codes between the characters, in the same way that
WordPerfect’s “reveal codes” view shows them. There is no header, no code for the start
or end of the file and no end-of-file ^Z.
Unlike the later versions, this one is described by its maker: WordPerfect Corporation published “WordPerfect File Information, Version 4.2”, which gives every code in octal. The reference pages follow that document, with notes from libwpd, the open-source WordPerfect reader.
Structure
Every byte has a meaning by its range: 0x00 to 0x1F are
control characters (tab, hard and soft returns, page breaks), 0x20 to
0x7F is ASCII text, 0x80 to 0xBF are single-byte
functions, and 0xC0 to 0xF8 start multiple-byte functions: the
code, its data, then the same code again, so that a reader can find the end of the
function. 0xFF separates fields inside variable-length functions.
textText ASCII characters and control characters, mixed with0x00–0x7F1 byteSingle-byte functions such as attributes on and off0x80–0xBFn bytesMultiple-byte functions a code, its data and the code again0xC0–0xF8
The function codes page lists every single-byte function, every multiple-byte function with its length and fields, the header and footer, footnote, paragraph numbering, marked text and tab reset data, password protection and the checks a reader makes to accept a file.
To recognise a 4.2 file: it has no header and no signature. A reader checks the
whole file for well-formed codes, because a plain text file must not be mistaken for a
document. A file that starts FE FF 61 61 is password-protected.
Not described
Known, not yet covered
- Viewer: the explorer has no WordPerfect viewer. A 4.2 file has no signature, so the explorer shows it as text or raw bytes. The codes are all listed on the function codes page, so a viewer can be built.
Unknown
- Reference: the two Macintosh-only codes
F7(leading) andF8(kerning adjustment), which the 1986 document lists without describing; see multiple-byte functions. - Reference: the end-of-record character of secondary merge files, which the 1986 document names but whose value is lost from the published text.
- Reference: the encrypted form. The 1986 document describes unencrypted files only; the scrambling is as libwpd reconstructed it, and no description was ever published by WordPerfect or its later owners (password protection).
Variants
- WordPerfect 4.2 and earlier for DOS – a headerless stream of text and function codes, described by WordPerfect Corporation’s own 1986 document
- WordPerfect for Macintosh – version 1.x headerless; versions 2.x to 3.5e with a WPC header and an embedded resource fork
- WordPerfect 5 – a WPC header, prefix packets, then the document area (DOS 5.0 and 5.1, Windows 5.1 and 5.2)
- WordPerfect 6 and later – a WPC header, an index header and packets; the layout kept by every later version
Links
Software
- LibreOffice Writer – free office suite’s word processor, which imports WordPerfect documents through libwpd (Windows, macOS, Linux)
Developers
- libwpd – library that reads WordPerfect documents including 4.2, used by LibreOffice (C++)
Reference
- WordPerfect File Information, Version 4.2 – WordPerfect Corporation’s own description of the 4.2 format (1986)
- WordPerfect for DOS Updated: software and file formats – notes on the formats, and that no documentation of encrypted files was ever available
- libwpd source code –
WP42FileStructure,WP42ParserandWP42Heuristics