[Lazarus] TProcess, UTF8, Windows

Lukasz Sokol el.es.cr at gmail.com
Fri Apr 13 13:28:59 CEST 2012


On 13/04/2012 09:58, Jürgen Hestermann wrote:
> Mattias Gaertner schrieb:
>> 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 am always astonished that we have come so far already!
> Today programmers have to guess about coding of strings,
> they cannot find out in documentation or by identifier name.
> Only trial and error (the latter mostly when the program
> is in production use) can be used. That's what I call C style
> and is not what Niklaus Wirth had in mind.
> 
> IMO it must be possible to predict the encoding of strings
> when writing the code (without running the program).

No one prohibits you to use an identifier name to reflect encoding ;)

Also : how do you think you'd guess encoding of a text file on disk 
before reading it ? Some people don't like to have the decision taken
by the compiler for themselves...

Other area where this may be important: web applications. 
Database fields may (each) have different encoding (and we would be able to know it),
internals of the app would work on their own encoding (and we would know it)
the web frontend may run on different encoding every time (and we would be able to know it )
(imagine somebody forces a certain encoding on their web browser and tells
the web app developer to support THAT)

I for one /like/ that The New Pascal has become highly customizable even if 
some things have to be more explicit than in Ye Olden Days...

It's still way more 'high level' than plain c that some people dub 'assembler on drugs'....

;)
L.





More information about the Lazarus mailing list