wenshan1 / gaephotos

Automatically exported from code.google.com/p/gaephotos
0 stars 0 forks source link

中文相册名会出问题 #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
我相册使用的中文名,
本来直接链接的图片应该是utf-8的,但是我也不知道为什么地
址错误记录里面会是gbk编码的,然后服务器就不能处理,
正常的应该是
http://www.ishareimg.tk/VPN%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95/andriod-7.jpg
但是会出来下面的链接地址
www.ishareimg.tk/VPN%C5%E4%D6%C3%B7%BD%B7%A8/andriod-7.jpg
不知道是否有办法解决,或者我就只有忽略这个了
在appengine看到错误代码是下面的,
'utf8' codec can't decode byte 0xc5 in position 3: invalid continuation byte. 
You passed in 'VPN\xc5\xe4\xd6\xc3\xb7\xbd\xb7\xa8' (<type 'str'>)
Traceback (most recent call last):
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~ishareimg/1.359190792577741269/main.py", line 835, in get
    self.send_photo(force_unicode(albumname), force_unicode(photoname), "photo")
  File "/base/python27_runtime/python27_lib/versions/third_party/django-1.2/django/utils/encoding.py", line 88, in force_unicode
    raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xc5 in position 3: 
invalid continuation byte. You passed in 'VPN\xc5\xe4\xd6\xc3\xb7\xbd\xb7\xa8' 
(<type 'str'>)

Original issue reported on code.google.com by yubinlov...@gmail.com on 7 Jun 2012 at 8:44

GoogleCodeExporter commented 9 years ago
可能是浏览器或者操作系统的问题吧. 
我可以访问你的相册啊.
你说的错误地址 
www.ishareimg.tk/VPN%C5%E4%D6%C3%B7%BD%B7%A8/andriod-7.jpg 
是在什么地方出现的?

Original comment by deepgu...@gmail.com on 7 Jun 2012 at 2:28

GoogleCodeExporter commented 9 years ago
我访问也正常,但是我从log里面看到这些错误

我又看了一下,主要是出在soso的蜘蛛百度蜘蛛上和IE6上
500 1704ms 0kb Mozilla/5.0 (compatible; Sosoimagespider/2.0; 
+http://help.soso.com/soso-image-spider.htm)
199.27.128.228 - - [06/Jun/2012:05:49:11 -0700] "GET 
/VPN%C5%E4%D6%C3%B7%BD%B7%A8/andriod-7.jpg HTTP/1.1" 500 174 - "Mozilla/5.0 
(compatible; Sosoimagespider/2.0; +http://help.soso.com/soso-image-spider.htm)" 
"www.ishareimg.tk" ms=1705 cpu_ms=903 api_cpu_ms=17 cpm_usd=0.025178 
loading_request=1 instance=00c61b117c43dbf7b050cb0165473b7367f93f

500 31ms 0kb Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 
1.1.4322; TencentTraveler)
124.115.11.38 - - [30/May/2012:06:02:58 -0700] "GET 
/VPN%C5%E4%D6%C3%B7%BD%B7%A8/andriod-8.jpg HTTP/1.1" 500 289 
"http://ishare.cn.ms/archives/330" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 
NT 5.1; SV1; .NET CLR 1.1.4322; TencentTraveler)" "www.ishareimg.tk" ms=32 
cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000090 
instance=00c61b117c16b8bcbe70882fedf989e6d3871444

可能是他们默认设置是gbk,算了不管了

Original comment by yubinlov...@gmail.com on 7 Jun 2012 at 3:18