IE浏览器url编码问题

27 views
Skip to first unread message

leeway1985

unread,
Feb 23, 2013, 3:19:45 AM2/23/13
to sh...@googlegroups.com, cp...@googlegroups.com
最近服务器错误上收到很多错误报告。 访问的人都是使用的 IE8 浏览器。 他们访问的url编码出现了错误。

'REQUEST_URI': '/restaurants/lat/31.3212899/lng/121.4447127?sort_by=order_count&doors=openorclosed&query=\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9&category=drinks',

有人知道是什么地方的设置 可以让 query 的内容 在url 中编码成 \xe8\x8f\x9c\xe5\x93\x81\xef\xbc\ 这样的东西?

这里的东西应该是 utf8 编码的 中文。 我在python中

In [2]: print '\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9'.decode('utf8')
菜品,餐厅,甜点

是可以得到结果的。


leeight的马甲

unread,
Feb 23, 2013, 3:23:18 AM2/23/13
to sh...@googlegroups.com, cp...@googlegroups.com
看样子是没有编码直接发送到服务器的,否则应该是
query=%E8%8F%9C%E5%93%81%EF%BC%8C%E9%A4%90%E5%8E%85%EF%BC%8C%E7%94%9C%E7%82%B9

leeway1985

unread,
Feb 23, 2013, 3:29:22 AM2/23/13
to sh...@googlegroups.com
�ǵ� ie9 ��û��������� ���Զ���������е��Ǹ����ӡ����� ie8 �����˺ܾö�û�ҵ�������������ó� ��Ҫ���� url  ������������⡣

û�����־�û�취ȷ���޸��������Ĵ����Dz�����Ч�� ��IE �����൱�����


On 02/23/2013 04:23 PM, leeight����� wrote:
��������û�б���ֱ�ӷ��͵��������ģ�����Ӧ����
query=%E8%8F%9C%E5%93%81%EF%BC%8C%E9%A4%90%E5%8E%85%EF%BC%8C%E7%94%9C%E7%82%B9

On Saturday, February 23, 2013 4:19:45 PM UTC+8, pyLemon wrote:
�������������� �յ��ܶ���󱨸档 ���ʵ��˶���ʹ�õ� IE8 ������� ���Ƿ��ʵ�url��������˴���

  'REQUEST_URI': '/restaurants/lat/31.3212899/lng/121.4447127?sort_by=order_count&doors=openorclosed&query=\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9&category=drinks',

����֪����ʲô�ط������� ������ query ������ ��url �б���� \xe8\x8f\x9c\xe5\x93\x81\xef\xbc\ ����Ķ�����

����Ķ���Ӧ���� utf8 ����� ���ġ� ����python��

In [2]: print '\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9'.decode('utf8')
��Ʒ���������

�ǿ��Եõ����ġ�


--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
���յ����ʼ�����Ϊ������ Google ������̳�ġ�Shanghai Linux User Group����̳��
Ҫ�˶�����̳��ֹͣ���մ���̳�ĵ����ʼ����뷢�͵����ʼ��� shlug+un...@googlegroups.com��
Ҫ�鿴���ѡ������ https://groups.google.com /groups/opt_out��
 
 

Alan Z

unread,
Feb 23, 2013, 4:03:43 AM2/23/13
to sh...@googlegroups.com
可以参照这篇文章 http://blog.csdn.net/wangjun_1218/article/details/4330244
你这个问题有点像文章里面的第二种


2013/2/23 leeway1985 <leewa...@gmail.com>
是的 ie9 就没有这个问题 会自动编码成你列的那个样子。但是 ie8 我找了很久都没找到在哪里可以设置成 不要编码 url  来复现这个问题。

没法复现就没办法确认修复这个问题的代码是不是有效。 对IE 真是相当的无语。



On 02/23/2013 04:23 PM, leeight的马甲 wrote:
看样子是没有编码直接发送到服务器的,否则应该是
query=%E8%8F%9C%E5%93%81%EF%BC%8C%E9%A4%90%E5%8E%85%EF%BC%8C%E7%94%9C%E7%82%B9

On Saturday, February 23, 2013 4:19:45 PM UTC+8, pyLemon wrote:
最近服务器错误上 收到很多错误报告。 访问的人都是使用的 IE8 浏览器。 他们访问的url编码出现了错误。

  'REQUEST_URI': '/restaurants/lat/31.3212899/lng/121.4447127?sort_by=order_count&doors=openorclosed&query=\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9&category=drinks',

有人知道是什么地方的设置 可以让 query 的内容 在url 中编码成 \xe8\x8f\x9c\xe5\x93\x81\xef\xbc\ 这样的东西?

这里的东西应该是 utf8 编码的 中文。 我在python中

In [2]: print '\xe8\x8f\x9c\xe5\x93\x81\xef\xbc\x8c\xe9\xa4\x90\xe5\x8e\x85\xef\xbc\x8c\xe7\x94\x9c\xe7\x82\xb9'.decode('utf8')
菜品,餐厅,甜点

是可以得到结果的。


--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com /groups/opt_out。
 
 

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
 
 



--
Alan Zhu
----------------------------------------
 

B.Tag

unread,
Mar 4, 2013, 1:42:53 AM3/4/13
to sh...@googlegroups.com
看到编码的问题头都大了...  最近一直处理编码的问题...

php 的话 用 urlencode() 函数处理
----------
个人

http://www.boolsir.com

GMAIL : bb....@gmail.com
 
Q  Q : 289871025


B.Tag

unread,
Mar 4, 2013, 1:44:07 AM3/4/13
to sh...@googlegroups.com
python 有个 urllib 库 貌似。。
Reply all
Reply to author
Forward
0 new messages