I've been using a program called par (offsite link) for quite some years now. It's a paragraph reformatter that I use mainly to justify text. When changed my system configuration to use UTF-8 everywhere (keyboard input, terminal output and so), par broke. Last weekend I searched some Perl module to replace it's functionality and, from the several results of my CPAN search, I picked one of which its description souded well: Text::Autoformat, by TheDamian. I'm encountering some problems with it but first, I'll show you the data (I replaced some characters with non-ASCII ones).
15:06. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fus +ce ligula. Curabitur blandit dui ut urna. Nullam vel eros. Mauris rhoncus + sem. Dóńéc luctus velit eget quam. Mauris pellentesque. Vivamus quam. Mauri +s ságittis vulputate mauris. Nulla consequat est aliquam urna fringilla lacinia. Nunc auctor sagittis tortor.
$ perl -MText::Autoformat -e' undef $/; print autoformat +<>, { right => 78, justify => "full", all => 1, lists => 0, }' < lorem-ipsum2 15:06. Lorem ipsum dolor sit amet, consectetuer adipiscing elit +. Fusce ligula. Curabitur blandit dui ut urna. Nullam vel eros. Mauris rhonc +us sem. Dóńéc luctus velit eget quam. Mauris pellentesque. Vivamus quam. M +auris ságittis vulputate mauris. Nulla consequat est aliquam urna fr +ingilla lacinia. Nunc auctor sagittis tortor.
15:06. Lorem ipsum dolor sit amet, consectetuer adipiscing elit +. Fusce ligula. Curabitur blandit dui ut urna. Nullam vel eros. Mauris rhon +cus sem. Dóńéc luctus velit eget quam. Mauris pellentesque. Vivamus quam. + Mauris ságittis vulputate mauris. Nulla consequat est aliquam urna f +ringilla lacinia. Nunc auctor sagittis tortor.
There are two issues here:
Is there anything I can do to sort these out? I suspect the first problem can only be solved by modifying the code but maybe the second is easier.
Update: Tagged the par link as offsite.
--
David Serrano
In reply to Text::Autoformat: usage and multibyte-encoded text by Hue-Bond
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |