ww2 = u'''
World War II (often abbreviated to WWII or WW2), also known as the Second World War, was a global war that lasted from 1939 to 1945, although related
'''
ww2 = unicode(ww2, 'utf-8')
ww2b = TextBlob(ww2)
答案 0 :(得分:0)
无论何时编码字符串,其类型都不能直接放入TextBlob()中。如果在TextBlob()调用之前使用介于两者之间的编码值,则需要先对其进行解码。同样,BLOB的全部要点是它们存储原始二进制字符串。因此,只需继续将您的内容直接存储到BLOB中,而无需对其进行编码。