#NEWLINE# def _get_download_filename( env , filename ) : #NEWLINE# #INDENT# from uliweb.utils.common import safe_str #NEWLINE# import urllib2 #NEWLINE# from werkzeug.useragents import UserAgent #NEWLINE# agent = UserAgent ( env ) #NEWLINE# fname = safe_str ( filename , 'utf8' ) #NEWLINE# if ( agent . browser == 'msie' ) : #NEWLINE# #INDENT# result = ( 'filename=' + urllib2 . quote ( fname ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( env . browser == 'safari' ) : #NEWLINE# #INDENT# result = ( 'filename=' + fname ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = ( "filename*=UTF-8''" + urllib2 . quote ( fname ) ) #NEWLINE# #UNINDENT# #UNINDENT# return result