[Lazarus] Feature Request: Insert {codepage UTF8} per default

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Mar 30 21:46:01 CEST 2016


On 2016-03-30 17:16, Bart wrote:
> Without {$codepage utf8} it outputs:
> DefaultSystemcodePage = 1252
> TestUtf8 = $C3 $84 $41 $C3 $84
> S1       = $C3 $84 $41 $C3 $84 [0]
> Ã"AÃ"
> 
> The compiler treats my source as if it were written in my system's codepage.
> With cp1552 S1 now contains garbage (Ã"AÃ"). (at least not what I
> expected it to be)

Just thought I would let you know that with or without the {$codepage
utf8}, your code works just fine here. Source code is saved in a UTF-8
encoding with no BOM marker.

========================================================
[tmp]$ fpc test.pas
Free Pascal Compiler version 3.0.0 [2015/11/16] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others

[tmp]$ ./test
DefaultSystemcodePage = 0
TestUtf8 = C38441C384
S1       = C38441C384 [0]
ÄAÄ

[.... adding $codepage and testing again.....]

[tmp]$ fpc test.pas
Free Pascal Compiler version 3.0.0 [2015/11/16] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others

[tmp]$ ./test
DefaultSystemcodePage = 0
TestUtf8 = C38441C384
S1       = C38441C384 [65001]
ÄAÄ
========================================================

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp




More information about the Lazarus mailing list