title: Java: How to detect (and change?) encoding of System.console?
body: <p>I have a program which runs on a console and its Umlauts and other special characters are being output as ?'s on Macs. Here's a simple test program:</p>
  
  <pre><code>public static void main( String[] args ) {
      System.out.println("höhößüä");
      System.console().printf( "höhößüä" );
  }
  </code></pre>
  
  <p>On a default Mac console (with default UTF-8 encoding), this prints:</p>
  
  <pre><code> h?h????
   h?h????
  </code></pre>
  
  <p>But after manually setting the Mac terminal's encoding to "Mac OS Roman", it correctly printed</p>
  
  <pre><code> höhößüä
   höhößüä
  </code></pre>
  
  <p>Note that on Windows systems using System.console() works:</p>
  
  <pre><code> h÷h÷▀³õ
   höhößüä
  </code></pre>
  
  <p>So how do I make my program...<em>rolleyes</em>..."run everywhere"?</p>