filter out non-ascii stuff from title tag

svn path=/branches/KDE/3.5/kdegraphics/kpdf/; revision=742212
remotes/origin/kpdf-3.5
Dirk Mueller 19 years ago
parent ec90bf76e8
commit 0d5e5b9519
  1. 9
      core/generator_pdf/generator_pdf.cpp

@ -455,11 +455,18 @@ bool PDFGenerator::print( KPrinter& printer )
{
pstitle = m_document->currentDocument().fileName( false );
}
QCString pstitle8Bit = pstitle.local8Bit();
// this looks non-unicode-safe and it is. anything other than ASCII is not specified
// and some printers actually stop printing when they encounter non-ASCII characters in the
// Postscript %%Title tag
QCString pstitle8Bit = pstitle.latin1();
const char* pstitlechar;
if (!pstitle.isEmpty())
{
pstitlechar = pstitle8Bit.data();
for (unsigned char* p = (unsigned char*) pstitle8Bit.data(); *p; ++p)
if (*p >= 0x80)
*p = '?';
printer.setDocName(pstitle);
}
else

Loading…
Cancel
Save