title: Why UTF-8 as native2ascii encoding option rather than ISO-8859-1?
body: <p>When create Properties class in Java, it requires the input stream must be encoded in ISO-8859-1. But in practice, I use UTF-8 to convert non-Latin properties files by native2ascii tool rather than ISO-8859-1.</p>
  
  <ul>
  <li>According to JDK doc, input stream should be encoded ISO-8859-1.
  That's to say, the source file is encoding in ISO-8859-1.</li>
  <li>According to decoding and encoding should using the same ISO-8859-1,
  Properties class in Java should decode using ISO-8859-1.</li>
  <li>According to testing, actually we use UTF-8 as encoding
  option in native2ascii rather than ISO-8859-1. Why?</li>
  </ul>
  
  <p>Test as follow:</p>
  
  <ul>
  <li>Create test.properties file which contains : "key=Ü"</li>
  <li><p>Generated ISO-8859-1  property file: key=\u00c3\u009c</p>
  
  <pre><code>  native2ascii -encoding ISO-8859-1 test.properties iso88591.propertie: 
  </code></pre></li>
  <li><p>Generated UTF-8 property file:  key=\u00dc</p>
  
  <pre><code>  native2ascii -encoding UTF-8 test.properties utf8.properties 
  </code></pre></li>
  <li><p>Create Properties to load the two generated property files:</p>
  
  <pre><code>Properties p = new Properties();
  //InputStream inStream = new FileInputStream("src/test/java/com/active/translation/iso88591.properties");
  InputStream inStream = new FileInputStream("src/test/java/com/active/translation/utf8.properties");
  p.load(inStream);
  
  System.out.println(p.getProperty("key"));
  </code></pre></li>
  <li><p>iso88591.propertie result is:  Ã</p></li>
  <li>utf8.properties result is: Ü</li>
  </ul>
  
  <p>Answer:</p>
  
  <p>That -encoding needs to match the actual encoding used in your source file. From the looks of it, that is UTF-8. – Thilo Apr 3 at 2:52</p>