title: Why hash results for ASCII differs when apply utf8 functions
body: <p>I have code:</p>
  
  <pre><code>push my( @list ), $x;
  utf8::upgrade( $tmp =  $x ); push @list, $tmp;
  utf8::downgrade( $tmp = $x ); push @list, $tmp;
  push @list, Encode::encode_utf8( $x );
  push @list, Encode::decode_utf8( $x );
  
  print Digest::SHA::hmac_sha256_hex( $_ ), "\n" for @list
  
  
  d9fa76e37bfe94cfcb0011cf070316775e52845021ee92d9bebe8ef289f87e16
  d9fa76e37bfe94cfcb0011cf070316775e52845021ee92d9bebe8ef289f87e16
  d9fa76e37bfe94cfcb0011cf070316775e52845021ee92d9bebe8ef289f87e16
  d9fa76e37bfe94cfcb0011cf070316775e52845021ee92d9bebe8ef289f87e16
  d9fa76e37bfe94cfcb0011cf070316775e52845021ee92d9bebe8ef289f87e16
  </code></pre>
  
  <p>Why when $x is <code>фыва</code> forth hash is different and the programm is crashed:</p>
  
  <pre><code>09165674df9a2eada20acb972bbf71d4cb5637b152d84568fd2e8fcbe9d61188
  09165674df9a2eada20acb972bbf71d4cb5637b152d84568fd2e8fcbe9d61188
  09165674df9a2eada20acb972bbf71d4cb5637b152d84568fd2e8fcbe9d61188
  36cdc4291ac91e26f76a208feb90e8a5a35729d54660bbb63acdb82746f7ec6a
  Wide character in subroutine entry at ./t3.pl line 7.
  </code></pre>
  
  <p>Please give me some light about utf8 magic. Thank you.</p>
  
  <p><strong>UPD</strong></p>
  
  <p>In app I should check data integrity by checking signs. Sometimes data come in UTF8. Before we do not handle that case. Here I am trying to check that sign will not be changed after:</p>
  
  <pre><code>Digest::SHA::hmac_sha256_hex( Encode::encode_utf8( $data ) )
  </code></pre>
  
  <p>In parallel I check what would be if I apply this or that function to incoming data.</p>
  
  <p>Yeah, I do not understand utf8, so I ask</p>