subprocess.Popen with a unicode path

前端 未结 4 1667
面向向阳花
面向向阳花 2020-12-10 07:01

I have a unicode filename that I would like to open. The following code:

cmd = u\'cmd /c \"C:\\\\Pok\\xe9mon.mp3\"\'
cmd = cmd.encode(\'utf-8\')
subprocess.P         


        
4条回答
  •  既然无缘
    2020-12-10 07:26

    I think windows uses 16-bit characters, not sure if it's UCS2 or UTF16 or something like that. So I guess that it could have an issue with UTF8.

提交回复
热议问题