From 3ad9fc7028bba05f6d9fbee7f5e3c18bcdd42264 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 7 Jun 2020 13:26:32 +0200 Subject: [PATCH] allow unicode filenames to work on Windows, too BUG: 422500 --- generators/djvu/kdjvu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/djvu/kdjvu.cpp b/generators/djvu/kdjvu.cpp index b324a1021..02a002c2a 100644 --- a/generators/djvu/kdjvu.cpp +++ b/generators/djvu/kdjvu.cpp @@ -670,8 +670,8 @@ bool KDjVu::openFile( const QString & fileName ) if ( d->m_djvu_document ) closeFile(); - // load the document... - d->m_djvu_document = ddjvu_document_create_by_filename( d->m_djvu_cxt, QFile::encodeName( fileName ).constData(), true ); + // load the document..., use UTF-8 variant to work on Windows, too, see bug 422500 + d->m_djvu_document = ddjvu_document_create_by_filename_utf8( d->m_djvu_cxt, fileName.toUtf8().constData(), true ); if ( !d->m_djvu_document ) return false; // ...and wait for its loading wait_for_ddjvu_message( d->m_djvu_cxt, DDJVU_DOCINFO ); @@ -887,7 +887,7 @@ void KDjVu::linksAndAnnotationsForPage( int pageNum, QList *links, { link->m_area = KDjVu::Link::PolygonArea; QPolygon poly; - for ( int j = 1; j < arealength; j += 2 ) + for ( int j = 1; j < arealength; j += 2 ) { poly << QPoint( miniexp_to_int( miniexp_nth( j, area ) ), miniexp_to_int( miniexp_nth( j + 1, area ) ) ); }