clientSystem = request.META['HTTP_USER_AGENT']
如果是windows则按cp936编码,否则按utf-8编码
if clientSystem.find('Windows') > -1:
filename = filename.encode('cp936')
else:
filename = filename.encode('utf-8')
response['Content-Disposition'] = 'attachment;filename=%s.xls' % filename