Encoding errors everywhere

So after hours of try and error, I just don't have any idea what I can do to fix this.

 

So I've got a folder with the Name "Black★Rock Shooter (OVA)".

2013-03-26 22:41:14,118 (1504) :  INFO (agentkit:914) - Searching for matches for {'show': 'Black\xe2\x98\x85rock Shooter Ova', 'id': '191', 'year': None}

 

does the Log tell me but by using media.show I'll get "Black★rock Shooter Ova" because media.show seems to be latin-1. this wouldn't be a problem because the API where I get the data from respond with "Black★Rock Shooter (OVA)". But then I get an exception

 

2013-03-26 22:45:45,384 (1898) :  CRITICAL (core:561) - Exception serializing TV_Show with guid 'de.daraku.plex.myanimelistagent://7059:Black★Rock Shooter (OVA)?lang=en' (most recent call last):
  File "C:\Users\Daraku\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\model.py", line 179, in _write
    self._serialize(os.path.join(self._storage_path, subdir))
  File "C:\Users\Daraku\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\model.py", line 204, in _serialize
    el.set('id', self._id)
  File "lxml.etree.pyx", line 699, in lxml.etree._Element.set (src\lxml\lxml.etree.c:34531)
  File "apihelpers.pxi", line 563, in lxml.etree._setAttributeValue (src\lxml\lxml.etree.c:15781)
  File "apihelpers.pxi", line 1366, in lxml.etree._utf8 (src\lxml\lxml.etree.c:22211)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

 

I searched for a solution for hours. I tried to encode with Latin-1 the title and decode it with utf-8 but then I get the message that \u2605 is not recognised. While trying to find a solution I found a map with this "code" on this website but I don't know how I should use it.

 

I just had an idea: When a suitable media is found the id is "transported" to the update method. because the API I use doesn't support a search for the ID of the media I needed to get the name into the update method so I just append it to the ID. I don't know if this causes the exception.

 

Nonetheless I need to find a way to get the encoding right.

 

Any suggestions?

since I'm using a new API to do the searching this thing is solved.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.