View Issue Details

IDProjectCategoryView StatusLast Update
0020817Lazarus-public2016-03-15 17:40
ReporterTakeda Matsuki Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.31 (SVN) 
Summary0020817: TProcessUTF8 : "Failed to Passing Unicode Characters in TProcessUTF8.CommandLine"
DescriptionI created an application to call another Executable (EXE) by Passing the parameter via TProcessUTF8 CommandLine..

My code snippets :

........

var
  AProcess: TProcessUTF8;
 
// starts to run
begin

  AProcess := TProcessUTF8.Create(nil);
 
  //mSentCommand is UTF8String Data Type, this is contain the Command and Another Exe. This var is
 //created to catch my Command to call another EXE
  AProcess.CommandLine := mSentCommand;
 
 
  AProcess.Options := [poWaitOnExit, poNoConsole, poUsePipes];
 

  AProcess.Execute;

   if ExitStatus <> 0 then
    begin
          with TStringList.Create do
            try
              LoadFromStream(StdErr);
              Msg := Text;
            finally
              Free;
            end;

          iMsg := 'Failed ! ';
     end
   else iMsg := 'Completed Successfully';
 
  AProcess.Free;
end.

.......

The EXE that I called via TProcessUTF8, is give the result 'Failed - [FilePath+FileName] is not available'.

Note :
1. I tested to passing the command via CommandLine, with this combination Korean Character + Normal Character.
2. I tested to create the folder with Korean & Vietnamese character and then give the same Error.
3. I use normal Windows (But I already install the suggestion from http://wiki.lazarus.freepascal.org/LCL_Unicode_Support)

mSentCommand is contain like this => Exe2 + Parameter + PathFileTargetToCallByExe2 + Parameter
NOTE : mSentCommand is UTF8String (In my test cases PathFileTargetToCallbyExe2 is contain File/folder with Korean/Vietnamese Language). Everything look fine when mSentCommand only contain "Normal Character" not "Special Character" like Korean/Vietnamese.

GUI Level show Unicode Character properly.. But When I pass the mSentCommand to AProcess.CommandLine it was fail to find the file in the folder with Korean/Vietnamese Language.. The real sad I got..
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0020835 closedBart Broersma ExpandFileNameUTF8 broken 

Activities

Takeda Matsuki

2011-12-05 01:02

reporter   ~0054717

Last edited: 2011-12-05 01:03

For e.g. : I call Mpress to compressing file inside Korean Folder and the filename is Vietnamese Language.

CommandLine:= MyAppPath\MPress\mpress.exe [someoption] C:\하마의-Folder\Phải có đôi lúc-win32 TC244 A2.exe

it give result tell to me, "there is no such as a file or directory..."

NOTE :
1. MPress was shipped with Unicode-Ready..
2. I tested using all version of Lazarus 0.9.31 and 0.9.30.1/2

Vincent Snijders

2012-03-13 11:25

manager   ~0057565

More Unicode support in the FPC RTL is needed.

Juha Manninen

2016-03-15 17:40

developer   ~0091082

This is solved by dynamic string encoding in FPC 3 and Lazarus 1.6.

Issue History

Date Modified Username Field Change
2011-12-05 00:57 Takeda Matsuki New Issue
2011-12-05 00:57 Takeda Matsuki Widgetset => Win32/Win64
2011-12-05 01:02 Takeda Matsuki Note Added: 0054717
2011-12-05 01:03 Takeda Matsuki Note Edited: 0054717
2012-03-13 11:24 Vincent Snijders Relationship added related to 0020835
2012-03-13 11:25 Vincent Snijders LazTarget => -
2012-03-13 11:25 Vincent Snijders Note Added: 0057565
2012-03-13 11:25 Vincent Snijders Status new => acknowledged
2016-03-15 17:40 Juha Manninen Note Added: 0091082
2016-03-15 17:40 Juha Manninen Status acknowledged => resolved
2016-03-15 17:40 Juha Manninen Resolution open => fixed
2016-03-15 17:40 Juha Manninen Assigned To => Juha Manninen