title: bash: encode URL to ISO-8859
body: <p>I'm currently using this to encode a URL (UTF-8):</p>
  
  <pre><code>ENCODED=$(echo -n "válue to éncôde" | \
  perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg');
  echo $ENCODED
  </code></pre>
  
  <p>How can I encode into ISO-8859 instead?</p>