Fix copying non-latin1 chars when xpdfrc does not exist.

svn path=/trunk/kdegraphics/kpdf/; revision=376506
This commit is contained in:
Jakub Stachowski 2005-01-08 16:21:43 +00:00
parent d42321176a
commit 6589342bf5
2 changed files with 5 additions and 4 deletions

View file

@ -107,7 +107,7 @@ const QString KPDFPage::getTextInRect( const QRect & rect, double zoom ) const
right = (int)((double)rect.right() / zoom),
bottom = (int)((double)rect.bottom() / zoom);
GString * text = m_text->getText( left, top, right, bottom );
return QString( text->getCString() );
return QString::fromUtf8( text->getCString() );
}

View file

@ -221,7 +221,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) {
psEmbedCIDTrueType = gTrue;
psOPI = gFalse;
psASCIIHex = gFalse;
textEncoding = new GString("Latin1");
textEncoding = new GString("UTF-8");
#if defined(WIN32)
textEOL = eolDOS;
#elif defined(MACOS)
@ -425,8 +425,9 @@ void GlobalParams::parseFile(GString *fileName, FILE *f) {
parseYesNo("psOPI", &psOPI, tokens, fileName, line);
} else if (!cmd->cmp("psASCIIHex")) {
parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
} else if (!cmd->cmp("textEncoding")) {
parseTextEncoding(tokens, fileName, line);
// Always use UTF-8 and allow QString do the magic
// } else if (!cmd->cmp("textEncoding")) {
// parseTextEncoding(tokens, fileName, line);
} else if (!cmd->cmp("textEOL")) {
parseTextEOL(tokens, fileName, line);
} else if (!cmd->cmp("textPageBreaks")) {