title: Get file's encoding in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/499010/java-how-to-determine-the-correct-charset-encoding-of-a-stream">Java : How to determine the correct charset encoding of a stream</a>  </p>
  </blockquote>
  
  
  
  <p>User will upload a CSV file to the server, server need to check if the CSV file is encoded as UTF-8. If so need to inform user, (s)he uploaded a wrong encoding file. The problem is <strong>how to detect the file user uploaded is UTF-8 encoding</strong>? The back end is written in Java. So anyone get the suggestion?</p>