How to open a file with chinese name in python -


I am trying to open a file in "w" mode with the "open ()" function in Python.

The file name is: ä »¿å® ?? ººçã ?? Æ.?. Jpg.

The open function fails with this file name, but succeeds with normal files.

How can I open a file with names in Python not in English?

My code is as follows:

  try: filename = urllib.quote (except: yield ("& lt; br & gt; error while opening file") file = Name ('utf-8')) Destination = Open (file name, 'w') yield ("

  #! / Usr / bin / python # - * - Coding: UTF-8 - * - Import codec f = codecs.open (u 'â' œ® ?? ººçã ?? æ. Txt ',' r ',' utf-8 ') f. Read () f.close ()   

worked fine here

Comments