http://qs321.pair.com?node_id=515427


in reply to What one-liners do people actually use?

I sometimes pipe stuff through the following one liner for utf8 conversion:
cat my_file | perl -e 'use Encode "from_to"; while (<>) {my $s = $_; f +rom_to($s,"iso-8859-1","utf8"); print $s}'

Replies are listed 'Best First'.
Re^2: What one-liners do people actually use?
by BrowserUk (Patriarch) on Dec 09, 2005 at 07:20 UTC

    You can save yourself a bit of typing there:

    perl -MEncode=from_to -pe"from_to( $_, 'iso-8859-1','utf8' )" infile > + outfile

    Switch the quotes on *nix.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: What one-liners do people actually use?
by Your Mother (Archbishop) on Dec 09, 2005 at 07:09 UTC

    Nice++. I was going to ask about something like this on SOPW the other day but was a bit embarrassed b/c I knew there must be a super simple way that I ought to be able to figure out myself.