diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 75130b012..8a9998540 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -127,16 +127,15 @@ class PptviewDocument(PresentationDocument): rect = renderer.screens.current[u'size'] rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom()) file_system_encoding = 'utf-16-le' - - filepath = os.path.normpath(self.filepath) - - preview_path = os.path.join(self.get_temp_folder(), u'slide') - + # Add a null char on the end otherwise we get spurious issues with + # the encoding. + file_path = os.path.normpath(self.filepath) + u'\0' + preview_path = os.path.join(self.get_temp_folder(), u'slide') + u'\0' + file_path = file_path.encode(file_system_encoding) + preview_path = preview_path.encode(file_system_encoding) if not os.path.isdir(self.get_temp_folder()): os.makedirs(self.get_temp_folder()) - filepath = filepath.encode(file_system_encoding) - preview_path = preview_path.encode(file_system_encoding) - self.pptid = self.controller.process.OpenPPT(filepath, None, rect, + self.pptid = self.controller.process.OpenPPT(file_path, None, rect, preview_path) if self.pptid >= 0: self.create_thumbnails() diff --git a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py index fb0460f41..7dea7621d 100644 --- a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py +++ b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py @@ -174,9 +174,8 @@ class PPTViewer(QtGui.QWidget): rect = RECT(int(self.xEdit.text()), int(self.yEdit.text()), int(self.widthEdit.text()), int(self.heightEdit.text())) filename = os.path.normpath(unicode(self.pptEdit.text())).encode('utf-16-le') - folder = unicode(self.folderEdit.text()).replace(u'/', u'\\') - self.pptid = self.pptdll.OpenPPT(filename, None, rect, filename.encode('utf-16-le') + folder.encode('utf-16-le')) - #self.pptid = self.pptdll.OpenPPT(filename, None, rect, filename + folder) + folder = os.path.normpath(unicode(self.folderEdit.text())).encode('utf-16-le') + self.pptid = self.pptdll.OpenPPT(filename, None, rect, folder) print u'id: ' + unicode(self.pptid) if oldid >= 0: self.pptdll.ClosePPT(oldid);