mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
RSS: Another attempt at fixing encoding issues (again).
This commit is contained in:
parent
ecadc05c7c
commit
0c2ab9d83b
@ -150,6 +150,7 @@ class RSS(callbacks.Plugin):
|
|||||||
if headline[2]:
|
if headline[2]:
|
||||||
pubDate = ' [%s]' % (headline[2],)
|
pubDate = ' [%s]' % (headline[2],)
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
|
if isinstance(headline[0], unicode):
|
||||||
try:
|
try:
|
||||||
import charade.universaldetector
|
import charade.universaldetector
|
||||||
u = charade.universaldetector.UniversalDetector()
|
u = charade.universaldetector.UniversalDetector()
|
||||||
@ -158,7 +159,6 @@ class RSS(callbacks.Plugin):
|
|||||||
encoding = u.result['encoding']
|
encoding = u.result['encoding']
|
||||||
except ImportError:
|
except ImportError:
|
||||||
encoding = 'utf8'
|
encoding = 'utf8'
|
||||||
if isinstance(headline[0], unicode):
|
|
||||||
newheadlines.append(format('%s %u%s',
|
newheadlines.append(format('%s %u%s',
|
||||||
headline[0].encode(encoding,'replace'),
|
headline[0].encode(encoding,'replace'),
|
||||||
link,
|
link,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user