[Lazarus] FPC 2.7.1 and console output
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed Dec 3 17:50:27 CET 2014
On Wed, 03 Dec 2014 16:46:43 +0100
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
>[...]
> Q: how do I debug the RTL (step into)?
Compile it with debugging info (-gl) and install it.
>[...]
> > If your code contains
> > literals for a specific Windows codepage then you are limiting
> > yourself to that codepage (not x-platform). That is your choice.
> > OTOH Lazarus main target is x-platform programs. For example the
> > UTF8ToConsole solution works on Unix too, while your CP1252
> > example does not.
>
> What's CP1252 specific in my example?
Your example works if you use CP1252 as source encoding, as I have
told you. I'm not sure why you call that a 'hack'.
>[...]
> >> Delphi string literals instead come with their true dynamic encoding, which
> >> never can be 0, and thus can be assigned and shown properly. Above code
> >> then will show CP=1252 and Len=4 for the AnsiString variable.
> >
> > No, it should show garbage and Len=7, because the source is UTF-8,
> > while the compiler treats it as your system codepage.
>
> Well, I tested my program with XE, with the default Windows textfile
> encoding.
Ah, so you tested CP1252 encoding under XE.
The same works under FPC.
> When FPC or Lazarus has problems with such a program file,
> then something is flawed :-(
PEBCAK
Mattias
More information about the Lazarus
mailing list