摘要: 使用Delphi对Json中的Unicode字符串进行解析:[{"name":"\u97e9\u56fd\u9996\u5c14KT\u670d\u52a1\u5668","ip":"211.115.67.40"},{"name":"\u97e9\u56fd\u5357\u90e8","ip":"211.115.67.40"}]function TForm1.DecodeUnicodeString(const S: string): s 阅读全文
posted @ 2013-03-10 17:26 叮叮当当 阅读(577) 评论(0) 推荐(0) 编辑
摘要: Delphi6下使用Indy10组件包,其中的TIdHttpServer控件在处理HTTP请求的时候不能正确解码含有汉字的参数,如:http://127.0.0.1/test?cmd=open&areaname=测试&areadir=D:\test对于这个Url,Chrome默认按UTF-8编码发送,IE默认按GBK编码发送,而这两种情况,TIdHttpServer的CommandGet事件中TIdHTTPRequestInfo.Params.Values['areaname']返回的均为乱码。用POST方式测试,也存在同样的问题。经过分析Indy的源码,发现主 阅读全文
posted @ 2013-03-10 17:20 叮叮当当 阅读(2868) 评论(0) 推荐(0) 编辑