title: Why is jasper generated report not showing cyrillic (bulgarian) in Java?
body: <p>I'm using <code>JDK 1.6.0_35</code> in a Java Project and I'm having a problem with java.util.ResourceBundle when recovering a properties file (encoded in <code>ISO8859-1</code>).</p>
  
  <p>We've been asked to show an invoice with english labels but an only one, which must be written in bulgarian. The issue is that it recovers and displays only the text which is not written in Bulgarian.</p>
  
  <p>I've tried to insert the text in two ways:</p>
  
  <pre><code>\u0424\u0430\u043A\u0442\u0443\u0440\u0430\r\n\u041E\u0440\u0438\u0433\u0438\u043D\u0430\u043B
  
  "Фактура\r\nОригинал"
  </code></pre>
  
  <p>Neither of them worked. I'm googling and it seems like it should work with the first way (though uncomfortable, it should work), but the text written like this does not display in my PDF (I'm using Jasperreports).</p>
  
  <p>When doing <code>JasperFillManager.fillReport()</code> my params variable contains "INVOICE=INVOICE/XXXФактураXXX", but when opening the PDF it only displays "INVOICE/XXX".</p>
  
  <p><strong>Java code</strong>:</p>
  
  <pre><code>Object obj = JRLoader.loadObject(new InputStream(someSource));
  JasperReport reportMaster = (JasperReport) obj;
  JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(data);
  JasperPrint jasperPrint = JasperFillManager.fillReport(reportMaster, params, ds);
  String pathArialFont = "";
  String pathArialBFont = "";
  String pathArialIFont = "";
  String pathArialBIFont = "";
  try {
      pathArialFont = Thread.currentThread().getContextClassLoader().getResource("arial.ttf").toURI()
          .toString();
  
  
      pathArialBFont = Thread.currentThread().getContextClassLoader().getResource("arialbd.ttf").toURI()
          .toString();
  
  
      pathArialIFont = Thread.currentThread().getContextClassLoader().getResource("ariali.ttf").toURI()
          .toString();
  
  
      pathArialBIFont = Thread.currentThread().getContextClassLoader().getResource("arialbi.ttf").toURI()
          .toString();
      LOGGER.debug("pathArialBIFont:".concat(pathArialBIFont));
  
  } catch (final URISyntaxException e) {
      LOGGER.error("", e);
  }
  
  String arial = "Arial";
  HashMap&lt;FontKey, PdfFont&gt; fontMap = new HashMap&lt;FontKey, PdfFont&gt;();
  FontKey key1 = new FontKey(arial, false, false);
  PdfFont font1 = new PdfFont(pathArialFont, BaseFont.CP1252, true);
  
  FontKey key2 = new FontKey(arial, true, false);
  PdfFont font2 = new PdfFont(pathArialBFont, BaseFont.CP1252, true);
  
  FontKey key3 = new FontKey(arial, false, true);
  PdfFont font3 = new PdfFont(pathArialIFont, BaseFont.CP1252, true);
  FontKey key4 = new FontKey(arial, true, true);
  PdfFont font4 = new PdfFont(pathArialBIFont, BaseFont.CP1252, true);
  
  fontMap.put(key1, font1);
  fontMap.put(key2, font2);
  fontMap.put(key3, font3);
  fontMap.put(key4, font4);
  
  JRPdfExporter exporter = new JRPdfExporter();
  exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
  exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, informe);
  exporter.setParameter(JRExporterParameter.FONT_MAP, fontMap);
  
  reportMaster.setProperty("net.sf.jasperreports.awt.ignore.missing.font", "true");
  
  exporter.exportReport();
  </code></pre>
  
  <p>Here you can see in one of my debuggings that the string arrives to Java code in cyrillic:</p>
  
  <p><a href="https://i.stack.imgur.com/21f9J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/21f9J.png" alt="Cyrillic comes correctly into Java"></a></p>
  
  <p><strong>fontsfamily1365159936026.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;fontFamilies&gt;
      &lt;fontFamily name="Arial"&gt;
          &lt;normal&gt;&lt;![CDATA[fonts/arial.ttf]]&gt;&lt;/normal&gt;
          &lt;bold&gt;&lt;![CDATA[fonts/arialbd.ttf]]&gt;&lt;/bold&gt;
          &lt;italic&gt;&lt;![CDATA[fonts/ariali.ttf]]&gt;&lt;/italic&gt;
          &lt;boldItalic&gt;&lt;![CDATA[fonts/arialbi.ttf]]&gt;&lt;/boldItalic&gt;
          &lt;pdfEncoding&gt;&lt;![CDATA[Cp1252]]&gt;&lt;/pdfEncoding&gt;
          &lt;pdfEmbedded&gt;&lt;![CDATA[false]]&gt;&lt;/pdfEmbedded&gt;
      &lt;/fontFamily&gt;
  &lt;/fontFamilies&gt;
  </code></pre>
  
  <p><strong>jasperreports_extension.properties</strong>:</p>
  
  <pre><code>net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.simple.font.families.ireportfamily1365159936026=fontsfamily1365159936026.xml
  </code></pre>
  
  <p>Any clue?</p>