Closed MrNick4B closed 5 years ago
Today, when executing the script, I got the following error:
All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
It seems that there can be control characters in the title, subtitle and descriptions of a program.
I fixed this for myself by replacing some lines in def addEvents2XML:
def addEvents2XML
Old:
... programme_desc.text = unescape(event['shortdesc']) ... programme_desc.text = unescape(event['longdesc']) ... programme_subtitle.text = unescape(subtitle) ... programme_title.text = title ...
New:
... programme_desc.text = re.sub(u'[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', unescape(event['shortdesc'])) ... programme_desc.text = re.sub(u'[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', unescape(event['longdesc'])) ... programme_subtitle.text = re.sub(u'[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', unescape(subtitle)) ... programme_title.text = re.sub(u'[^\u0020-\uD7FF\u0009\u000A\u000D\uE000-\uFFFD\U00010000-\U0010FFFF]+', '', title)
Looks like this is a duplicate issue, sorry! #5
thanks
Today, when executing the script, I got the following error:
It seems that there can be control characters in the title, subtitle and descriptions of a program.
I fixed this for myself by replacing some lines in
def addEvents2XML
:Old:
New: