I do have the following path in the memory:
video_path = u'C:\\Documents and Settings\\user\\My Documents\\Downloads\\\xf5iv - Neon Phoenix [Free DL].mp3'
I'm trying to use it as a parameter in cmd, so I have to encode it.
video_path = video_path.encode(sys.getfilesystemencoding())
cmd = 'ffmpeg -y -i "%s" -vn -ac 2 -f mp3 audio.mp3' % video_path
subprocess.Popen(cmd)
However the string is not encoded in the right way - it converts the \xf5
to ?
instead of õ
. Therefore the file could not be found.
How can this happen? I'm using the default filesystem encoding (which is mbcs).