title: Displaying Japanese Characters using DOMpdf
body: <h2>Problem:</h2>
  
  <p>I want to generate a pdf using <a href="https://github.com/dompdf" rel="nofollow">DomPDF</a> that includes Japanese text. In order to do so I know that I need a font that supports Japanese characters and to load the font into DomPDF.<br>
  I have read the <a href="https://github.com/dompdf/dompdf/wiki/UnicodeHowTo" rel="nofollow">UnicodeHowTo</a> of DomPDF and several similar questions on SO but I can not seem to get it to work. I get <code>?</code> at the place where the Japanese characters should be.</p>
  
  <p>In my dompdf config I have set <code>def("DOMPDF_UNICODE_ENABLED", true);</code> and it shows true in the admin interface as well.  The font I use (I have tried several) should support japanese characters and is loaded in DomPDF using the <code>load_font.php</code> script. I do have to note for the sake of completeness that generating the font files gives me 2 identical warnings</p>
  
  <blockquote>
    <p>Warning: strftime(): It is not safe to rely on the system's timezone
    settings. You are <em>required</em> to use the date.timezone setting or the
    date_default_timezone_set() function. In case you used any of those
    methods and you are still getting this warning, you most likely
    misspelled the timezone identifier. We selected the timezone 'UTC' for
    now, but please set date.timezone to select your timezone. in ..</p>
  </blockquote>
  
  <h2>Minimal (not) working example:</h2>
  
  <p>Relevant html stored in PHP variabe <code>$template</code>:</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  &lt;META http-equiv="X-UA-Compatible" content="IE=8"&gt;
  &lt;TITLE&gt;Test voucher&lt;/TITLE&gt;
  &lt;STYLE type="text/css"&gt;
  
  
  @font-face {
        font-family: \'mgenplus\';
        font-style: normal;
        font-weight: 400;
        src: url(dompdf/fonts/rounded-mgenplus-1c-regular.ttf) format(\'truetype\');
   }
  .ft0{font: 14px;line-height: 16px;}
  *{ font-family: mgenplus !important;}
  &lt;/STYLE&gt;
  &lt;/HEAD&gt;
  
  &lt;BODY&gt;
  &lt;P&gt;ねん だい かい にほんごのうりょくしけん&lt;/P&gt;
  &lt;!-- .... --&gt;
  </code></pre>
  
  <p>Relevant PHP:</p>
  
  <pre><code>require_once("dompdf/dompdf_config.inc.php");
  $template = mb_convert_encoding($template, 'HTML-ENTITIES', 'UTF-8');
  $dompdf = new DOMPDF();
  $dompdf-&gt;load_html($template, 'UTF-8');
  $dompdf-&gt;render();
  $dompdf-&gt;stream("test.pdf",array('Attachment'=&gt;0));
  </code></pre>
  
  <p>If anybody has a suggestion or see if I missed something, it would be appreciated!</p>