title: Encoding in Java
body: <p>I have an C# function which i want to translate in Java code. I have a problem here:</p>
  
  <pre><code>Encoding enc = Encoding.GetEncoding("Windows-1252");
  
  bytZeichenBenutzer = enc.GetBytes(strBenutzer.Substring(intLoopCount, 1).ToCharArray());
  </code></pre>
  
  <p>How to do that in Java? I can't find anything similar only stuff that works with UTF-8.</p>