title: FontFactory (lowagie), Java, getting UnsupportedEncodingException when trying to use UniJIS-UCS2-H (for Japanese)
body: <p>I am using <code>com.lowagie.text.FontFactory</code> in generating a PDF file and am trying to use a custom font, KozMinPro-Regular, which provides support for Japanese characters, as we have a need to support this. I have found examples from searching that show how to do this similar to how I am doing it below and these examples assume that <code>UniJIS-UCS2-H</code> encoding is supported but when I try this I am getting the exception below that says this encoding is not supported. I would appreciate if anyone may have any insight into this. Thanks</p>
  
  <pre><code>FontFactory.register("/usr/share/fonts/truetype/KozMinPro-Regular.ttf", "JapaneseCompatible");
  contentFont = FontFactory.getFont("JapaneseCompatible", "UniJIS-UCS2-H", true, 11, Font.BOLD);
  headerFont = FontFactory.getFont("JapaneseCompatible", "UniJIS-UCS2-H", true, 11, Font.BOLD);
  </code></pre>
  
  <p>The exception I get:</p>
  
  <pre><code> Exception: [.ReportPdfView] Exception caught during generation of pdf file. Cause: UniJIS-UCS2-H
  ExceptionConverter: java.io.UnsupportedEncodingException: UniJIS-UCS2-H
      at java.lang.StringCoding.encode(StringCoding.java:286)
      at java.lang.String.getBytes(String.java:954)
      at com.lowagie.text.pdf.PdfEncodings.convertToBytes(Unknown Source)
      at com.lowagie.text.pdf.TrueTypeFont.&lt;init&gt;(Unknown Source)
      at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
      at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
      at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
      at com.lowagie.text.FontFactoryImp.getFont(Unknown Source)
      at com.lowagie.text.FontFactoryImp.getFont(Unknown Source)
      at com.lowagie.text.FontFactory.getFont(Unknown Source)
      at com.lowagie.text.FontFactory.getFont(Unknown Source)
  </code></pre>