code: def make_encoded_file_url_and_params(file_service, share, file_dir, file_name, sas_token, safe=SAFE_CHARS):
      
      try:
          file_url = file_service.make_file_url(share, file_dir, file_name, sas_token=sas_token)
      except UnicodeEncodeError:
          file_dir = file_dir.encode('utf-8')
          file_name = file_name.encode('utf-8')
          file_url = file_service.make_file_url(share, file_dir, file_name, sas_token=sas_token)
  
      if not file_dir:
          sep = file_url.find('://')
          file_url = file_url[:sep + 3] + file_url[sep + 3:].replace('//', '/')
      return encode_url_path(file_url, safe), file_dir, file_name
docs: Makes the file url using the service. Converts the file directory and name into byte-strings if needed and returns
      (url, dir, file) as a tuple. This is needed to account for string encoding differences between python 2 and 3.