<div dir="ltr"><div class="gmail_extra">Can anyone confirm if TProcessUTF8 handles unicode parameters under windows?</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm using Win 8 64bit/Laz 32 bit trunk/FPC Trunk. I'm struggling here with no unicode background, reading madly and hunting away...</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://wiki.lazarus.freepascal.org/LCL_Unicode_Support">http://wiki.lazarus.freepascal.org/LCL_Unicode_Support</a> makes it clear FPC is not unicode aware, though good improvements are being made in trunk...<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">I've traced through the code as best I can - TProcessUTF8 descends from TProcess. The overriden .Execute in TProcessUTF8, calls TProcess.Execute. Inside TProcess.Execute (win\process.inc) CreateProcess is called (which looks very much like it calls CreateProcessA, not CreateProcessW). And all the relevant parameters involved are PChars, whereas I think CreateProcessW will require PWideChars, confirming the CreateProcessA suspicion.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">As I understand things, we'll need TProcess to be unicode aware before TProcessUTF8 itself is fully unicode aware....</div><div class="gmail_extra"><br></div>
<div class="gmail_extra">My issue is down to a unicode filename being passed through as a parameter</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">Var</div><div class="gmail_extra">
FPlayerProcess: TProcessUTF8;</div><div class="gmail_extra">...</div><div class="gmail_extra"> FPlayerProcess.Executable:=FMPlayerPath;</div><div class="gmail_extra"> FPlayerProcess.Parameters.Add(AnsiToUTF8(Filename));</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">mplayer is reporting it can't find a corrupted version of the Filename I pass through. Works just fine with non-unicode filenames... (and I can pass mplayer the unicode filename in Command Prompt and it works there)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If someone could confirm my suspicions that TProcessUTF8 is likely the problem, I'll stop trying to fix the code at my end, and just put this down as a known issue for now (sure, and I'll log an item in the bugtracker though I can't see how to easily create a small test :) )... OTOH, if I'm completely wrong, I'll continue to slog away...</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Many thanks</div><div class="gmail_extra"><br></div><div class="gmail_extra">Mike T</div></div></div>