Hi Werner,

> Try the groff2uni perl script below.  Note that you will get warnings
> like
> 
>   Wide character in print at groff2uni.pl line 17, <> line 8.
> 
> Any Perl expert here who can fix that?  

The good news is it's a long time since I consdered myself that.  The
bad news is they've gone and added even more twisty passages since that
time.  (Python's the answer  ;-)

It seems "binmode" is now used for lots more than specifying the binary
mode of a file handle.  I think this is the right way to fix it.

    $ perl -we 'use strict; print chr(300)' | hexdump -C
    Wide character in print at -e line 1.
    00000000  c4 ac                                             |..|
    00000002
    $ perl -we 'use strict; binmode STDOUT, ":utf8"; print chr(300)' |
    > hexdump -C
    00000000  c4 ac                                             |..|
    00000002
    $

Cheers,


Ralph.



Reply via email to