【Python】 过滤 微博 四字节表情
2017-06-16 00:00
344 查看
项目中有时需要过滤掉四字节以上的字符(表情),比如MySQL数据库5.5.3以下的版本text字段不支持四字节以上字符
于是就需要过滤掉再入库,Python中的方法为:
于是就需要过滤掉再入库,Python中的方法为:
try: # python UCS-4 build的处理方式 highpoints = re.compile(u'[\U00010000-\U0010ffff]') except re.error: # python UCS-2 build的处理方式 highpoints = re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]') resovle_value = highpoints.sub(u'??', src_string)
相关文章推荐
- python 过滤四字节字符 表情字符
- python 表情过滤
- python 正则过滤四字节字符
- python emoji 表情过滤
- python 利用正则过滤表情符号
- Python亚马逊采集之emoj表情过滤
- python emoji 表情过滤
- Android腾讯微博客户端开发四:微博发送篇(QQ表情,@搜索)
- 关于字符 字节 python3
- Android腾讯微博客户端开发四:微博发送篇(QQ表情,@搜索)
- Python:获取新浪微博用户的收听列表和粉丝列表
- Dive Into Python 学习记录3-getattr 介绍/过滤列表/and or/lambda 函数
- python3 字符串和字节之间的转换
- 过滤iphone表情
- Python 新浪微博 各种表情使用频率
- 新浪微博表情浪小花的创作过程分享
- Python:获取新浪微博用户的收听列表和粉丝列表
- Python实现64位整型主机字节顺序和网络字节顺序的转换
- 微博内容过滤