str.encode 把字符串编码成字节序列 bytes.decode 把字节序列解码成字符串 https://docs.python.org/3.5/library/stdtypes.html Return an encoded version of the string as a bytes o ...
分类:
编程语言 时间:
2017-08-30 11:51:37
阅读次数:
170
HtmlTestRunner的乱码问题 1生成的报告中,对print打印的数据都记录下来,但是数据有些会存在乱码。如下面。有些又没有乱码。 这到底是怎么回事呢? str=t.encode('utf-8') print str str=t.encode('utf-8') print str 第一个te ...
分类:
编程语言 时间:
2017-08-29 18:10:31
阅读次数:
154
class Program { static void Main(string[] args) { Console.WriteLine("客务端"); TcpClient cline; // 与服务器连接 try { ... ...
分类:
其他好文 时间:
2017-08-29 17:18:14
阅读次数:
185
类似今日头条,页面上有很多card,点击每个card跳转该card的详情页面。这里有一个问题,当我滚动页面时,会先后触发touchstart、touchmove、touchend,但是当touchend后,页面仍会因为惯性而继续滚动。这个时候,我想点击页面停止滚动,而不是跳转到某个card的详情页面 ...
分类:
其他好文 时间:
2017-08-29 16:50:32
阅读次数:
199
jquery.nicescroll完美滚动条使用方法(转) 配置参数 :当调用“niceScroll”你可以传递一些参数来定制视觉方面: cursorcolor - 十六进制改变光标颜色,默认值是“#000000” cursoropacitymin - 改变不透明度非常光标处于非活动状态(scrol ...
分类:
Web程序 时间:
2017-08-28 19:59:57
阅读次数:
175
static function utf8_to_unicode($c) { switch(strlen($c)) { case 1: return ord($c); case 2: $n = (ord($c[0]) & 0x3f) > 6); $... ...
分类:
其他好文 时间:
2017-08-27 12:47:17
阅读次数:
118
虽然escape()、encodeURI()、encodeURIComponent()三种方法都能对一些影响URL完整性的特殊 字符进行过滤。但后两者是将字符串转换为UTF-8的方式来传输,解决了页面编码不一至导致的乱码问 题。例如:发送页与接受页的编码格式(Charset)不一致(假设发送页面是G ...
分类:
Web程序 时间:
2017-08-26 13:41:28
阅读次数:
333
题目描述 最近房地产商GDOI(Group of Dumbbells Or Idiots)从NOI(Nuts Old Idiots)手中得到了一块开发土地。据了解,这块土地是一块矩形的区域,可以纵横划分为N×M块小区域。GDOI要求将这些区域分为商业区和工业区来开发。根据不同的地形环境,每块小区域建 ...
分类:
其他好文 时间:
2017-08-26 11:29:26
阅读次数:
159
s = "图片picture"print chardet.detect(s) for c in s.decode('utf-8'): print c UnicodeEncodeError: 'ascii' codec can't encode character u'\u5728' in posit ...
分类:
Web程序 时间:
2017-08-25 21:04:01
阅读次数:
343