title: JDK 1.5 Properties load with unicode characters
body: <p>JDK 1.5 Properties <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#load%28java.io.InputStream%29" rel="nofollow">load</a> method only gets InputStream while JDK 1.6+ <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.Reader%29" rel="nofollow">load</a> method also gets also Reader. When a string with Unicode characters is loaded to a properties object on JDK 1.6+ with load(reader), there is no problem. But on JDK 1.5 there is only load(InputStream) method; when loaded to properties unicode characters are not correctly loaded.</p>
  
  <pre><code>Properties props = new Properties();
  ByteArrayInputStream bis = null;
  Reader reader = null;
  try {
          bis = new ByteArrayInputStream(someStringWithUnicodeChars.getBytes("UTF-8"));
          reader = new InputStreamReader(bis, "UTF-8");
      } catch (UnsupportedEncodingException ex) {
          ex.printStackTrace();
      }
  
  props.load(reader); // This reads unicode characters correctly on JDK 1.6+
  
  // There is no props.load(reader) method on JDK 1.5, so below method is used
  props.load(bis);
  // but Unicode characters are not loaded correctly.
  </code></pre>
  
  <p>How can I load following example string with unicode characters to properties object.</p>
  
  <pre><code>key1=test İ Ş Ğ
  key2=ÇÇÇÇ
  </code></pre>