If I store your sample text on my local drive, then convert that text file to utf8 (because what you have posted is iso-8859-1 or equivalent -- i.e. single-byte per accented character), I can solve one of your problems by adding "-CS" to the perl command line:
perl -CS -MText::Autoformat -e'...
That extra option tells perl to set utf8 discipline for both STDIN and STDOUT (the equivalent of doing  binmode ..., ":utf8" on both file handles).

As for the left-margin problem (why is it indenting all the lines), if I delete the initial whitespace from the beginning of the sample data, the indentation goes away completely (including on the first line). That also happens if I add an explicit option for the left margin in the hash of config settings:  left => 1

Apparently, the docs are a bit misleading about what the default behavior is: the actual behavior is that if a string begins with whitespace, the default is to prepend that much whitespace to all the wrapped lines on output. I haven't found anything yet in the man page that talks about indenting only the first line of a paragraph.

(update: If your input data is really 8859-1, you can use "-CO" (capital letter o) instead of "-CS", and perl will do the Right Thing. If the input is actually some other non-utf8 encoding, you'll need to use  binmode STDIN, ":encoding(whatever)" for perl to read it properly, and then still use "-CO" to output utf8.)


In reply to Re: Text::Autoformat: usage and multibyte-encoded text by graff
in thread Text::Autoformat: usage and multibyte-encoded text by Hue-Bond

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.