You can get the WordStar document format at:

http://www.wotsit.org/

From the format document:

A raw stream of the printable text in a WordStar file could therefore be discerned by masking off the 8th bit and discarding codes in the range of 00h through 1Fh. This method would, of course, omit all formatting and control information in the file. In addition to stripping control characters, symmetrical sequences must be stripped. See the description of symmetrical sequences below.

I would try the following to remove control codes:

$/ = undef; open FH, "< $wordstarfile" or die "craps. $!"; $doc = <FH>; # delete all ctrl chars except newline $doc =~ tr/\x00-\x09\x0b-\x1f//d; # turn off all high bits $doc =~ s/([\xa0-\xff])/chr(ord($1) ^ 0x80)/eg; print $doc;

This would toss out all your control characters and formatting sequences, so you'd probably want to see what your results look like, then dive into the format document and start figuring out how much of the original formatting you want to preserve.


In reply to Re: Binary data by converter
in thread Binary data by maderman

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.