← Back to team overview

openlp-core team mailing list archive

[Bug 1698021] Re: Copying and Pasting from Word inserts invalid characters

 

We could try to fix it by filtering out control chars as done here: https://stackoverflow.com/questions/8733233/filtering-out-certain-bytes-in-python
Note that there is a regex solution that is listed as the second answer that is much faster than the accepted answer...

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1698021

Title:
  Copying and Pasting from Word inserts invalid characters

Status in OpenLP:
  New

Bug description:
  We have reports from users coming in all the time for this.

  When a user copies and pastes a song from Word into OpenLP, Word seems
  to stick various control characters into the edit box which are
  invisible (or at least, plebians don't see them). When the user clicks
  "Save", the following exception is thrown:

  Traceback (most recent call last):
  File "openlp\plugins\songs\forms\editsongform.py", line 991, in accept
  File "openlp\plugins\songs\forms\editsongform.py", line 1027, in save_song
  File "openlp\plugins\songs\forms\editsongform.py", line 304, in _process_lyrics
  File "openlp\plugins\songs\lib\openlyricsxml.py", line 102, in add_verse_to_lyrics
  File "lxml.etree.pyx", line 2972, in lxml.etree.CDATA.__cinit__ (src\lxml\lxml.etree.c:69195)
  File "apihelpers.pxi", line 1393, in lxml.etree._utf8 (src\lxml\lxml.etree.c:27125)
  ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

  Can someone on Windows please try to reproduce this and figure out
  what those control characters are?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1698021/+subscriptions


References