pptviewlib does not accept unicode filename

Bug #1012110 reported by Samuel Findlay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Status tracked in Trunk
2.0
Fix Released
Medium
Phill
Trunk
Fix Released
Medium
Phill

Bug Description

If PowerPoint Viewer is being used by presentation plugin, loading a presentation file whose filename/path contains unicode (non-ASCII) characters causes a traceback:

--- Exception Traceback ---
Traceback (most recent call last):
  File "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.core.lib.mediamanageritem", line 342, in onFileClick
  File "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.core.lib.mediamanageritem", line 396, in validateAndLoad
  File "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.plugins.presentations.lib.mediaitem", line 194, in loadList
  File "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.plugins.presentations.lib.pptviewcontroller", line 128, in load_presentation
UnicodeEncodeError: 'ascii' codec can't encode characters in position 60-61: ordinal not in range(128)

Line 128 in load_presentation in pptviewcontroller uses str() on the filepath. This is due to a limitation of the C/C++ pptviewlib. It's OpenPPT function takes a *filename argument of type char. Thus it is unable to deal with unicode strings.

see http://www.support.openlp.org/issues/724

[WinXP SP3, OpenLP 1.9.9]

Related branches

tags: added: pptviewlib
Changed in openlp:
importance: Undecided → Low
Revision history for this message
Jonathan Corwin (j-corwin) wrote :

Samuel, did you reproduce this? I tried with a non-ascii character filename but it worked fine. However I'm on Windows 7, not XP.

Revision history for this message
Samuel Findlay (sfindlay) wrote : Re: [Bug 1012110] Re: pptviewlib does not accept unicode filename

No I haven't. Still waiting on more information from the user. The bug
report was my deduction from looking at the code, but it may not be valid.

Will follow up.

---
Sent from my mobile
On Jun 21, 2012 7:00 AM, "Jonathan Corwin" <email address hidden>
wrote:

> Samuel, did you reproduce this? I tried with a non-ascii character
> filename but it worked fine. However I'm on Windows 7, not XP.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1012110
>
> Title:
> pptviewlib does not accept unicode filename
>
> Status in OpenLP - Worship Presentation Software:
> New
>
> Bug description:
> If PowerPoint Viewer is being used by presentation plugin, loading a
> presentation file whose filename/path contains unicode (non-ASCII)
> characters causes a traceback:
>
> --- Exception Traceback ---
> Traceback (most recent call last):
> File
> "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.core.lib.mediamanageritem",
> line 342, in onFileClick
> File
> "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.core.lib.mediamanageritem",
> line 396, in validateAndLoad
> File
> "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.plugins.presentations.lib.mediaitem",
> line 194, in loadList
> File
> "D:\OpenLP_Code\release-1.9.9\build\pyi.win32\OpenLP\outPYZ1.pyz\openlp.plugins.presentations.lib.pptviewcontroller",
> line 128, in load_presentation
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> 60-61: ordinal not in range(128)
>
> Line 128 in load_presentation in pptviewcontroller uses str() on the
> filepath. This is due to a limitation of the C/C++ pptviewlib. It's
> OpenPPT function takes a *filename argument of type char. Thus it is
> unable to deal with unicode strings.
>
> see http://www.support.openlp.org/issues/724
>
> [WinXP SP3, OpenLP 1.9.9]
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openlp/+bug/1012110/+subscriptions
>

Changed in openlp:
status: New → Incomplete
tags: added: presentations
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenLP because there has been no activity for 60 days.]

Changed in openlp:
status: Incomplete → Expired
Revision history for this message
Phill (phill-ridout) wrote :

I can replicate this on Windows XP using the char 'ø' see: http://support.openlp.org/issues/2087

Changed in openlp:
status: Expired → In Progress
assignee: nobody → Phill (phill-ridout)
milestone: none → 2.0.4
tags: added: support-system
Revision history for this message
Phill (phill-ridout) wrote :

In 2.0 we're converting the strings to ASCII using str() as Pythoin 3 is unicode, str converts to unicode by default.

When changing 2.0 to use unicode powerpoint reports that it cannot find the file "c" this also happens in 2.1 (python 3) so I believe the dll is not handling unicode

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.