runfile:='C:\tên.exe';if ShellExecute(0,nil,PChar(runfile),PChar(''),nil,1) =0 then;]
var runfile : widestring;
Use Utf8ToSys(runfile) in the call to ShellExecute, or use TProcessUtf8 instead.Bart
i don't know whether this can work in windows at all... but you need to declare at least your filename as widestring and not as string:Code: [Select]var runfile : widestring;
var runfile : widestring;if ShellExecute(0,nil,PChar(utf8tosys(runfile)),PChar(''),nil,1) =0 then;
if ShellExecute(0,nil,PChar(utf8tosys(runfile)),nil,nil,1) =0 then;
Code: [Select]if ShellExecute(0,nil,PChar(utf8tosys(runfile)),nil,nil,1) =0 then;try this one
Change string to widestring, and assign all string variables to widestring. Then typecast them to pwidechar and call shellexecuteW instead of shellexecute.
if ShellExecutew(0,nil,PwideChar('C:\tên.exe'),PWideChar(''),nil,1) =0 then;
Did you try it uppercase????
Quote from: marcov on October 26, 2014, 10:46:28 amChange string to widestring, and assign all string variables to widestring. Then typecast them to pwidechar and call shellexecuteW instead of shellexecute.I have tried this code but it doesn't works:Code: [Select]if ShellExecutew(0,nil,PwideChar('C:\tên.exe'),PWideChar(''),nil,1) =0 then;
var s :widestring; s:=utf8decode('c:\withaccentswhatever'); shellexecutew (..., pwidechar(s)....);
Quote from: hy on October 26, 2014, 02:33:48 pmDid you try it uppercase????Using ShellExecuteW, right?
Quote from: nocuttree on October 26, 2014, 02:19:36 pmQuote from: marcov on October 26, 2014, 10:46:28 amChange string to widestring, and assign all string variables to widestring. Then typecast them to pwidechar and call shellexecuteW instead of shellexecute.I have tried this code but it doesn't works:Code: [Select]if ShellExecutew(0,nil,PwideChar('C:\tên.exe'),PWideChar(''),nil,1) =0 then; Change string to widestring, and assign all string variables to widestring Use utf8decode if necessary.so Code: [Select] var s :widestring; s:=utf8decode('c:\withaccentswhatever'); shellexecutew (..., pwidechar(s)....);
Quote from: nocuttree on October 26, 2014, 02:19:36 pmQuote from: marcov on October 26, 2014, 10:46:28 amChange string to widestring, and assign all string variables to widestring. Then typecast them to pwidechar and call shellexecuteW instead of shellexecute.I have tried this code but it doesn't works:Code: [Select]if ShellExecutew(0,nil,PwideChar('C:\tên.exe'),PWideChar(''),nil,1) =0 then; Quote from: engkin on October 26, 2014, 03:03:39 pmQuote from: hy on October 26, 2014, 02:33:48 pmDid you try it uppercase????Using ShellExecuteW, right?Quote from: hy on October 26, 2014, 02:33:48 pmI would strongly recommend not using other characters than 23..127 for filenames with Windows.Did you try it uppercase????Change string to widestring, and assign all string variables to widestring Use utf8decode if necessary.so Code: [Select] var s :widestring; s:=utf8decode('c:\withaccentswhatever'); shellexecutew (..., pwidechar(s)....);
I would strongly recommend not using other characters than 23..127 for filenames with Windows.Did you try it uppercase????