title: file encoding from any encoding to utf-8 in linux perl
body: <p>I want to convert text file ip.txt 's encoding to US-ASCII regardless of whatever ip.txt's encoding. </p>
  
  <p>When I am trying <code>raw:encoding(UTF-16LE)</code> error are coming as <strong><em>UTF-16LE:Partial character at script.perl line 10</em></strong> but when I am using</p>
  
  <p><code>raw:encoding(US-ASCII)</code> errors are like <strong><em>ascii "\xC0" does not map to Unicode at script.perl line 10.</em></strong></p>
  
  <pre><code>use strict;
  use warnings;
  
  my $old= '/home/ip.txt';
  my $new = '/home/out.txt';
  open(my $myold, "&lt;:raw:encoding(UTF-16LE):crlf:utf8", $old) or
  die "Could not open file 1 $!";
  open(my $mynew, "&gt;&gt;", $new) or
  die "Could not open file 2 $!";
  while( my $line = &lt;$myold&gt; )
  {
      print {$mynew} $line;
  }
  
  close($myold);
  close($mynew);
  </code></pre>
  
  <p>Please suggest how to use :raw:encoding():lf:utf8? What does it work, please explain it too?</p>