Skip to content

Commit

Permalink
Solve crash on utf-8 encoding
Browse files Browse the repository at this point in the history
When you want to add a timer you can get "Nothing" as channels when in one
of the channels something went unexpected with utf-8 encoding.
  • Loading branch information
littlesat committed Jan 24, 2016
1 parent 186ea35 commit ed54d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/controllers/models/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ def getServices(sRef, showAll = True, showHidden = False):
if not st & 512 or showHidden:
if showAll or st == 0:
service = {}
service['servicereference'] = sitem[0].encode("utf8")
service['servicename'] = sitem[1].encode("utf8")
service['servicereference'] = unicode(sitem[0], 'utf_8', errors='ignore').encode('ASCII', 'ignore')
service['servicename'] = unicode(sitem[1], 'utf_8', errors='ignore').encode('ASCII', 'ignore')
services.append(service)

return { "services": services }
Expand Down

0 comments on commit ed54d2a

Please sign in to comment.