Heh, I did exactly the same thing! I still remember parts of the specs.

There's a series of header blocks that define global properties of the document, and can be pretty much safely ignored. In the first dozen bytes or so there's a word (i.e. 16 bit value) that contains the offset in the file that is the first byte past the header blocks. I don't remember the offset, nor do I remember the endianness.

After the header blocks it's pretty simple. Characters 0x00-0x7f are emitted as is. There are also fixed-length and variable-length blocks embedded in the stream that you have to deal with. (These correspond to the WordPerfect markup, à la "Reveal Codes").

Fixed length blocks are introduced with a marker byte in the range of 0xc0-0xcf. There follows a fixed amount of characters, followed by a matching 0xc0-0xcf.

Variable-length blocks are a bit trickier. They are introduced with a marker byte in the range of 0xb0-0xbf. The first word after the marker byte encodes the length of the block. At the end of the block you also have a matching 0xb0-0xbf marker byte.

With a hex-viewer you should be able to puzzle it out. It's funny how time changes things. The format used to be documented in several places on the Web. Right now I can't find a single useful/complete definition any more. Hmm, nor do I have my old source code to this application anymore either. Hmmmm.


In reply to Re:x2 (Sorta OT) - Historic Wordperfect Conversion by grinder
in thread (Sorta OT) - Historic Wordperfect Conversion by zakzebrowski

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.