title: ISO-8859-1 encoding and binary data preservation
body: <p>I read in a <a href="https://stackoverflow.com/questions/12913264/eclipse-vs-tomcat-deployment-exported-war-partially-fails-while-the-project#comment22524058_15745520">comment</a> to an answer by @Esailija to a question of mine that </p>
  
  <blockquote>
    <p>ISO-8859-1 is the only encoding to fully retain the original binary data, with exact byte&lt;->codepoint matches</p>
  </blockquote>
  
  <p>I also read in this <a href="https://stackoverflow.com/a/520954/281545">answer</a> by @AaronDigulla that :</p>
  
  <blockquote>
    <p>In Java, ISO-8859-1 (a.k.a ISO-Latin1) is a 1:1 mapping</p>
  </blockquote>
  
  <p>I need some insight on this. This will fail (as illustrated <a href="https://stackoverflow.com/q/14720995/281545">here</a>) :</p>
  
  <pre><code>// \u00F6 is ö
  System.out.println(Arrays.toString("\u00F6".getBytes("utf-8")));
  // prints [-61, -74]
  System.out.println(Arrays.toString("\u00F6".getBytes("ISO-8859-1")));
  // prints [-10]
  </code></pre>
  
  <h3>Questions</h3>
  
  <ol>
  <li>I admit I do not quite get it - <em>why does it not get the bytes in the code above</em> ?</li>
  <li>Most importantly, <strong><em>where is this</em></strong> (<em>byte preserving behavior of</em> <code>ISO-8859-1</code>) <strong><em>specified</em></strong> - links to source, or JSL would be nice. Is it the only encoding with this property ?</li>
  <li>Is it related to <code>ISO-8859-1</code> being the <a href="https://stackoverflow.com/a/12659567/281545">default default</a> ?</li>
  </ol>
  
  <p>See also <a href="https://stackoverflow.com/questions/2544965/why-new-stringbytes-enc-getbytesenc-does-not-return-the-original-byte-array">this question</a> for nice counter examples from other charsets.</p>