摘要: 参考:http://my.oschina.net/waterbear/blog/149852chardet模块,能够实现文本编码的检查,核心代码:import chardetchardet.detect(content)['encoding']实现目录java文件转码:#-*- coding: utf-8 -*-import codecsimport osimport shutilimport reimport chardetdef convert_encoding(filename, target_encoding): # Backup the origin file. sh 阅读全文
posted @ 2013-12-18 14:55 Sudawei 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 转自:http://wiki.neal365.com/2013/02/25/android%E5%8F%91%E9%80%81%E6%8E%A5%E6%94%B6json%E5%8C%85%E5%90%AB%E4%B8%AD%E6%96%87%E7%9A%84%E5%A4%84%E7%90%86/问题:在Android向Python实现的Wsgi接口发送json格式的http请求是,server不能正确解析,入库的中文字段为一串问号???????,在server端反复解码无效,查找资料,是在Android发送json时没有指定utf8,指定后,一切OK。即在发送的时候用utf-8编码,接收的时 阅读全文
posted @ 2013-12-18 14:37 Sudawei 阅读(734) 评论(0) 推荐(0) 编辑