[Lazarus] TProcess, UTF8, Windows
Marcos Douglas
md at delfire.net
Thu Apr 12 22:30:20 CEST 2012
On Thu, Apr 12, 2012 at 5:20 PM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> On Thu, 12 Apr 2012 12:34:59 -0300
> Marcos Douglas <md at delfire.net> wrote:
>
>> Hi,
>>
>> I'm using the example in FreePascal wiki to execute external programs:
>> http://wiki.freepascal.org/Executing_External_Programs#Reading_large_output
>>
>> I adapted this code to work in LCL, using a simple TMemo.
>> All "write" and "writeln" was replaced with
>> Memo1.Lines.Append(ConsoleToUTF8(<text or variable>)).
>
> What is the source of <text or variable>?
> The output of the other process?
I mean Write('.') or WriteLn(OutputLines[NumBytes]) etc.
See the original code in the wiki.
>> Everything works fine... but since I changed this line:
>> OurProcess.Options := [poUsePipes];
>> to
>> OurProcess.Options := [poUsePipes, poNoConsole];
>>
>> ...the conversion ConsoleToUTF8 do not work.
>>
>> Any tips?
>
> Maybe the other process's output is not in console codepage.
> Try
>
> Memo1.Lines.Append(<text or variable>)
> or
> Memo1.Lines.Append(SysToUTF8(<text or variable>)).
I will try... but I see other problem now. The example read all buffer
before print on screen (in my case, a TMemo).
I want to print on time. I will change the code for this before try
UTF8 conversion.
Do you have an example for I need?
Marcos Douglas
More information about the Lazarus
mailing list