Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: What one-liners do people actually use?

by Siddartha (Curate)
on Dec 09, 2005 at 00:13 UTC ( #515427=note: print w/replies, xml ) Need Help??

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 (Pope) 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 (Chancellor) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://515427]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2016-10-24 10:58 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (305 votes). Check out past polls.