'Test encoding'

def test_encoding(self):

    root_dir = u'C:\\Temp\\TV'
    strings = [u'Les    Enfants    De    La    T\xe9l\xe9', u'RT\ufffd    One']
    sickbeard.SYS_ENCODING = None
    try:
        locale.setlocale(locale.LC_ALL, u'')
        sickbeard.SYS_ENCODING = locale.getpreferredencoding()
    except (locale.Error, IOError):
        pass
    if ((not sickbeard.SYS_ENCODING) or (sickbeard.SYS_ENCODING in (u'ANSI_X3.4-1968', u'US-ASCII', u'ASCII'))):
        sickbeard.SYS_ENCODING = u'UTF-8'
    for test in strings:
        try:
            show_dir = ek(os.path.join, root_dir, sanitize_filename(test))
            self.assertTrue(isinstance(show_dir, six.text_type))
        except Exception as error:
            ex(error)
