Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Tomas Hajny via fpc-pascal
On 2020-09-14 16:09, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: application (let's say notepad.exe) will result in garbage. I don't say that it is necessarily bad, but it should be documented at least if we want to keep it that way. I would definitely

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Tomas Hajny via fpc-pascal
On 2020-09-14 16:09, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: application (let's say notepad.exe) will result in garbage. I don't say that it is necessarily bad, but it should be documented at least if we want to keep it that way. I would definitely

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Benito van der Zander via fpc-pascal
Hi, I would definitely keep it that way. As I see it: Redirection or not should not matter, the system should assume console output. Things like 'tee' make this concept dubious in any case: If you pipe output to a program, you don't expect the codepage to change because of the

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: application (let's say notepad.exe) will result in garbage. I don't say that it is necessarily bad, but it should be documented at least if we want to keep it that way. I would definitely keep it that way. As I see it: Redirection or

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Tomas Hajny via fpc-pascal
On 2020-09-14 14:51, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: opened: {$ifdef FPC_HAS_FEATURE_ANSISTRINGS} { if no codepage is yet assigned then assign default ansi codepage } TextRec(t).CodePage:=TranslatePlaceholderCP(TextRec(t).CodePage);

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: opened: {$ifdef FPC_HAS_FEATURE_ANSISTRINGS} { if no codepage is yet assigned then assign default ansi codepage } TextRec(t).CodePage:=TranslatePlaceholderCP(TextRec(t).CodePage); {$else FPC_HAS_FEATURE_ANSISTRINGS} I see no need to

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Tomas Hajny via fpc-pascal
On 2020-09-14 14:20, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-14 13:39, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-12 23:03, Tomas Hajny wrote: On 2020-09-12 18:51, Jonas Maebe via

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-14 13:39, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-12 23:03, Tomas Hajny wrote: On 2020-09-12 18:51, Jonas Maebe via fpc-pascal wrote: On 12/09/2020 18:44, Sven Barth via

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Tomas Hajny via fpc-pascal
On 2020-09-14 13:39, Michael Van Canneyt wrote: On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-12 23:03, Tomas Hajny wrote: On 2020-09-12 18:51, Jonas Maebe via fpc-pascal wrote: On 12/09/2020 18:44, Sven Barth via fpc-pascal wrote: Jonas Maebe via fpc-pascal

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Sep 2020, Tomas Hajny via fpc-pascal wrote: On 2020-09-12 23:03, Tomas Hajny wrote: On 2020-09-12 18:51, Jonas Maebe via fpc-pascal wrote: On 12/09/2020 18:44, Sven Barth via fpc-pascal wrote: Jonas Maebe via fpc-pascal > schrieb am Sa.,

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-13 Thread Tomas Hajny via fpc-pascal
On 2020-09-12 23:03, Tomas Hajny wrote: On 2020-09-12 18:51, Jonas Maebe via fpc-pascal wrote: On 12/09/2020 18:44, Sven Barth via fpc-pascal wrote: Jonas Maebe via fpc-pascal > schrieb am Sa., 12. Sep. 2020, 17:47: . . While performing some tests,

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-13 Thread LacaK via fpc-pascal
<<< text/html;charset=utf-8: Unrecognized >>> ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-12 Thread Tomas Hajny via fpc-pascal
On 2020-09-12 18:51, Jonas Maebe via fpc-pascal wrote: On 12/09/2020 18:44, Sven Barth via fpc-pascal wrote: Jonas Maebe via fpc-pascal > schrieb am Sa., 12. Sep. 2020, 17:47: > All the doubts, questions, and discussions prove that current

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-12 Thread Jonas Maebe via fpc-pascal
On 12/09/2020 18:44, Sven Barth via fpc-pascal wrote: > Jonas Maebe via fpc-pascal > schrieb am Sa., 12. Sep. 2020, > 17:47: > > > All the doubts, questions, and discussions prove that current > system is > > counter-intuitive and confusing. >

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-12 Thread Sven Barth via fpc-pascal
Jonas Maebe via fpc-pascal schrieb am Sa., 12. Sep. 2020, 17:47: > > All the doubts, questions, and discussions prove that current system is > > counter-intuitive and confusing. > > The issue in this thread is caused by a bug in the LCL: it blindly > assumes that the dynamic code page of the

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-12 Thread Jonas Maebe via fpc-pascal
On 12/09/2020 16:58, Santiago A. via fpc-pascal wrote: > https://wiki.freepascal.org/Unicode_Support_in_Lazarus#Assign_string_literals_to_different_string_types > is scaring. The first table is useless. If you don't tell the compiler what the code page is of the source file, it's normal that you

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-12 Thread Santiago A. via fpc-pascal
El 09/09/2020 a las 10:02, Bart via fpc-pascal escribió: On Wed, Sep 9, 2020 at 8:37 AM LacaK via fpc-pascal wrote: I am still confused how this CodePage aware stuff is expected to work and when implicit conversios are included (as far as I understand here ONLY declared/static codepage

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-10 Thread LacaK via fpc-pascal
> .>>> The implicit conversion is explicitly expected by the user>>> in this case if I understand it correctly (source in CP1250), right?>> >> If you mean the "non implicit conversion" requires explicit>> conversion by the user, then yes.> > No, I mean that the original poster explicitly

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Tomas Hajny via fpc-pascal
On 2020-09-09 17:59, Mattias Gaertner via fpc-pascal wrote: On Wed, 09 Sep 2020 17:44:11 +0200 Tomas Hajny via fpc-pascal wrote: . . The implicit conversion is explicitly expected by the user in this case if I understand it correctly (source in CP1250), right? If you mean the "non

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Jonas Maebe via fpc-pascal
On 09/09/2020 17:37, Mattias Gaertner via fpc-pascal wrote: > On Wed, 09 Sep 2020 17:25:09 +0200 > Tomas Hajny via fpc-pascal wrote: > >> On 2020-09-09 13:51, LacaK via fpc-pascal wrote: >> [...] >> A simple question - is TLabel.Caption declared as Utf8String (I don't >> use Lazarus)? _Then_ it

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Mattias Gaertner via fpc-pascal
On Wed, 09 Sep 2020 17:44:11 +0200 Tomas Hajny via fpc-pascal wrote: > On 2020-09-09 17:37, Mattias Gaertner via fpc-pascal wrote: > > On Wed, 09 Sep 2020 17:25:09 +0200 > > Tomas Hajny via fpc-pascal wrote: > > > >> On 2020-09-09 13:51, LacaK via fpc-pascal wrote: > >> [...] > >> A simple

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Tomas Hajny via fpc-pascal
On 2020-09-09 17:37, Mattias Gaertner via fpc-pascal wrote: On Wed, 09 Sep 2020 17:25:09 +0200 Tomas Hajny via fpc-pascal wrote: On 2020-09-09 13:51, LacaK via fpc-pascal wrote: [...] A simple question - is TLabel.Caption declared as Utf8String (I don't use Lazarus)? _Then_ it should work

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Tomas Hajny via fpc-pascal
On 2020-09-09 17:30, Bart via fpc-pascal wrote: On Wed, Sep 9, 2020 at 5:25 PM Tomas Hajny via fpc-pascal wrote: A simple question - is TLabel.Caption declared as Utf8String No. No wonder that the implicit conversion doesn't work then. Adding an explicit conversion would be another

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Mattias Gaertner via fpc-pascal
On Wed, 09 Sep 2020 17:25:09 +0200 Tomas Hajny via fpc-pascal wrote: > On 2020-09-09 13:51, LacaK via fpc-pascal wrote: >[...] > A simple question - is TLabel.Caption declared as Utf8String (I don't > use Lazarus)? _Then_ it should work without any issues and/or special > attention from users.

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Bart via fpc-pascal
On Wed, Sep 9, 2020 at 5:25 PM Tomas Hajny via fpc-pascal wrote: > A simple question - is TLabel.Caption declared as Utf8String No. -- Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Tomas Hajny via fpc-pascal
On 2020-09-09 13:51, LacaK via fpc-pascal wrote: > This is a bit counter intuitive to me. It is explained here: https://wiki.freepascal.org/Unicode_Support_in_Lazarus IMO "c4" case (c4: String1250 = 'áéíóčž';) is not fully explained. Probably what here happens is, that declared code page of

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread LacaK via fpc-pascal
> This is a bit counter intuitive to me. It is explained here: https://wiki.freepascal.org/Unicode_Support_in_Lazarus IMO "c4" case (c4: String1250 = 'áéíóčž';) is not fully explained. Probably what here happens is, that declared code page of c4 = source file code page and in that case

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Juha Manninen via fpc-pascal
On Wed, Sep 9, 2020 at 11:40 AM Bart via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > This is a bit counter intuitive to me. It is explained here: https://wiki.freepascal.org/Unicode_Support_in_Lazarus For LacaK I recommend using UTF-8 encoding as much as possible. Then everything

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread Bart via fpc-pascal
On Wed, Sep 9, 2020 at 8:37 AM LacaK via fpc-pascal wrote: > I am still confused how this CodePage aware stuff is expected to work and > when implicit conversios are included (as far as I understand here ONLY > declared/static codepage plays role) and when dynamic codepage is taken into >

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-09 Thread LacaK via fpc-pascal
attached simple Lazarus compilable project (one Form). ... type   String1250 = type AnsiString(1250); const   c2: AnsiString = 'áéíóčž';   c3: WideString = 'áéíóčž';   c4: String1250 = 'áéíóčž'; { TForm1 } procedure TForm1.FormShow(Sender: TObject); begin   label1.Caption:='áéíóčž'; //

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-08 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Di., 8. Sep. 2020, 22:32: > On Tue, 8 Sep 2020 20:27:20 +0200 > Jonas Maebe via fpc-pascal wrote: > > > On 07/09/2020 08:51, LacaK via fpc-pascal wrote: > > > > > attached simple Lazarus compilable project (one Form). > > > > > > ... > > > type > > >

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-08 Thread Mattias Gaertner via fpc-pascal
On Tue, 8 Sep 2020 20:27:20 +0200 Jonas Maebe via fpc-pascal wrote: > On 07/09/2020 08:51, LacaK via fpc-pascal wrote: > > > attached simple Lazarus compilable project (one Form). > > > > ... > > type > >   String1250 = type AnsiString(1250); > > > > const > >   c2: AnsiString = 'áéíóčž'; > >

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-08 Thread Jonas Maebe via fpc-pascal
On 07/09/2020 08:51, LacaK via fpc-pascal wrote: > attached simple Lazarus compilable project (one Form). > > ... > type >   String1250 = type AnsiString(1250); > > const >   c2: AnsiString = 'áéíóčž'; >   c3: WideString = 'áéíóčž'; >   c4: String1250 = 'áéíóčž'; > > { TForm1 } > > procedure

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-07 Thread LacaK via fpc-pascal
Hello Jonas, attached simple Lazarus compilable project (one Form). ... type   String1250 = type AnsiString(1250); const   c2: AnsiString = 'áéíóčž';   c3: WideString = 'áéíóčž';   c4: String1250 = 'áéíóčž'; { TForm1 } procedure TForm1.FormShow(Sender: TObject); begin  

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-05 Thread Jonas Maebe via fpc-pascal
On 03/09/2020 07:19, LacaK via fpc-pascal wrote: > I would like to have source file in Windows-1250 encoding, where are > stored literal strings like 'áéíóčž' in Windows-1250 encoding (I share > this one file between FPC/Lazarus and Delphi 7). Windows-1250 is also > ANSI code page of my Windows

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-03 Thread LacaK via fpc-pascal
Hi *, I would like to have source file in Windows-1250 encoding, where are stored literal strings like 'áéíóčž' in Windows-1250 encoding (I share this one file between FPC/Lazarus and Delphi 7). Windows-1250 is also ANSI code page of my Windows OS. In source file I have: {$IFDEF FPC}  

Re: [fpc-pascal] String literals and code page of .pas source file

2020-09-03 Thread Sven Barth via fpc-pascal
Am 03.09.2020 um 07:19 schrieb LacaK via fpc-pascal: Hi *, I would like to have source file in Windows-1250 encoding, where are stored literal strings like 'áéíóčž' in Windows-1250 encoding (I share this one file between FPC/Lazarus and Delphi 7). Windows-1250 is also ANSI code page of my

[fpc-pascal] String literals and code page of .pas source file

2020-09-02 Thread LacaK via fpc-pascal
Hi *, I would like to have source file in Windows-1250 encoding, where are stored literal strings like 'áéíóčž' in Windows-1250 encoding (I share this one file between FPC/Lazarus and Delphi 7). Windows-1250 is also ANSI code page of my Windows OS. In source file I have: {$IFDEF FPC}