Having a problem with unicode filenames (again with mplayer) on Windows 8 64bit running Lazarus 32bit Trunk/FPC Trunk...
Var
FPlayerProcess: TProcessUTF8;
...
FPlayerProcess.Executable:=FMPlayerPath;
FPlayerProcess.Parameters.Add(AnsiToUTF8(Filename));
FPlayerProcess.Execute;
If I pass a non-unicode filename to this, everything works, and I get the following by querying FPlayerProcess.output
MPlayer Redxii-SVN-r37216-4.8.2 (i686) (C) 2000-2014 MPlayer Team
Compiled against FFmpeg version N-63644-ge1bd40f
Build date: Sat May 31 22:08:38 EDT 2014
Playing B:\Code\Compile\Test Data\Clip_1080_5sec_VC1_15mbps.wmv.
...
On the other hand, if I pass a file with a unicode name ("skiing - ǤǥǦ.avi") into the procedure, then instead I see
MPlayer Redxii-SVN-r37216-4.8.2 (i686) (C) 2000-2014 MPlayer Team
Compiled against FFmpeg version N-63644-ge1bd40f
Build date: Sat May 31 22:08:38 EDT 2014
Playing B:\Code\Compile\Test Data\skiing - ǤǥǦ.avi.
Exiting... (End of file)
I've confirmed from the command line that mplayer itself will play the file with the unicode filename. So it's looks like it's down to my handling of unicode filenames. Somehow I'm mangling "skiing - ǤǥǦ.avi" into "skiing - ǤǥǦ.avi"
I've tried this with both
FPlayerProcess.Parameters.Add(AnsiToUTF8(Filename)); // mplayer reports can't find "skiing - ǤǥǦ.avi"
and
FPlayerProcess.Parameters.Add(Filename); // mplayer reports can't find "skiing - GgG.avi"
I've also tried UTF8ToAnsi, and UTF8ToSys (both of which return "skiing - GgG.avi")...
Incidently in ALL cases, the Process ends with both an exitcode and exitstatus of 0.
So, how do I pass a Unicode filename into UTF8Process.Parameters?