mysql 插入数据时,出现"\xF0\x9F\x8F\x80"这种情况的处理!
删除内容中的表情符号
import emoji
import re
def del_emoji(text):
text = emoji.demojize(text)
result = re.sub(':\S+?:', ' ', text)
result = result.replace("(●'◡'●)", '')
return result
# print(result)
if __name__ == '__main__':
text = "迷人的魚香一上桌就撲鼻而來,肉質經過微煎熟度恰恰好(●'◡'●)"
text = del_emoji(text)
print(text)