title: How to convert character set in Java?
body: <pre><code>SftpFile agencyFile = (SftpFile)agencyiter.next();
  
  LOGGER.info(" agencyFile.getAbsolutePath() "+ agencyFile.getAbsolutePath());
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>agencyFile.getAbsolutePath() /Agency_Ja????n
  </code></pre>
  
  <p>In my above code I am getting the <code>agencyFile.getAbsolutePath()</code> as with special characters like <code>???</code>.</p>
  
  <p>How can I avoid them?</p>
  
  <p>I tried also the following code, but got the same output.</p>
  
  <pre><code>byte[] ptext = agencyFile.getAbsolutePath().getBytes(ISO_8859_1); 
  String value = new String(ptext, UTF_8); 
  </code></pre>