title: pdfmark: some accented characters in titles of generated PDF bookmarks are not displayed properly
body: <p>I'm inserting bookmarks to existing PDF and have some problem with accented "c". There is the example (charset used in the example is UTF-8):</p>
  
  <pre><code>$name = "Ruční nářadí";
  
  $name = chr(254).chr(255).iconv('UTF-8', 'UTF-16BE', str_replace(array('(',')','/'),array('\\(','\\)','\\/'),$name));
  
  $fh = fopen('pdfmark.txt', 'w');
  fputs($fh, "[/Title ({$name}) /Page 1 /OUT pdfmark\n");
  fclose($fh);
  
  $command = "gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf final.pdf pdfmark.txt; mv out.pdf final.pdf";
  exec($command);
  </code></pre>
  
  <p>The problem is that accented <code>č</code> appears in bookmark of final PDF as <code>Ċ</code> (uppercase letter with different accent). I tried other accented characters used in my language (Czech) and except of this one everything is ok.</p>
  
  <p>Thanks for any clues to solve this issue.</p>
  
  <p><strong>EDIT (2013-02-01):</strong></p>
  
  <p>Version of GhostScript used is 9.06 (2012-08-08).
  I'm using Adobe Reader 11.0.1 to view the resulting PDF file.</p>
  
  <p>I'm still thinking about it...Does it have to be encoding specified in PDF in some way? Because the source PDF is out of my control and I know quite nothing about it. If it is the case, is there any way to use GS or pdfmark to do so?
  I thought that if the encoding of the bookmarks is Unicode so it realy doesn't matter, but maybe I'm wrong.</p>
  
  <p><strong>EDIT (2013-02-05):</strong></p>
  
  <p>There seems to be bug in GS's pdfwrite or Acrobat, more info in <a href="http://bugs.ghostscript.com/show_bug.cgi?id=693614" rel="nofollow">GS's bug tracking</a>. I will write solution info here, after it will be resolved.</p>