make sure part is encoded string (BeautifulSoup sometimes does not encode input
This commit is contained in:
parent
51cc5a6d36
commit
707d7abf6d
1 changed files with 2 additions and 0 deletions
|
@ -115,4 +115,6 @@ def extractFirstPart(value):
|
|||
else:
|
||||
text = stripAll(value)
|
||||
part = sentencePattern.split(text)[0]
|
||||
if isinstance(part, unicode):
|
||||
part = part.encode('UTF-8')
|
||||
return ('<p>%s</p>' % part).decode('utf8')
|
||||
|
|
Loading…
Add table
Reference in a new issue