Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-03 Thread Ondrej Pokorny
On 03.01.2020 11:09, Michael Van Canneyt wrote: I also think it is very hypothetical, and not a problem unless you want to use the same stream in Delphi and FPC. Well, you have my blessing for the soPreserveBOM :) Added in r43848. I'll check how the FPC documentation works and try to add it

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-03 Thread Michael Van Canneyt
On Fri, 3 Jan 2020, Ondrej Pokorny wrote: On 03.01.2020 10:14, Michael Van Canneyt wrote: On Fri, 3 Jan 2020, Ondrej Pokorny wrote: On 03.01.2020 00:35, Werner Pamler wrote: Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny: TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-03 Thread Ondrej Pokorny
On 03.01.2020 10:14, Michael Van Canneyt wrote: On Fri, 3 Jan 2020, Ondrej Pokorny wrote: On 03.01.2020 00:35, Werner Pamler wrote: Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny: TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not written. There is also the problem that

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-03 Thread Michael Van Canneyt
On Fri, 3 Jan 2020, Ondrej Pokorny wrote: On 03.01.2020 00:35, Werner Pamler wrote: Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny: TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not written. There is also the problem that currently it is not possible, without further

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-03 Thread Ondrej Pokorny
On 03.01.2020 00:35, Werner Pamler wrote: Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny: TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not written. There is also the problem that currently it is not possible, without further action, to retain the BOM state of a file loaded

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-02 Thread Werner Pamler
Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny: TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not written. There is also the problem that currently it is not possible, without further action, to retain the BOM state of a file loaded into a stringlist, modified and written

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2020-01-02 Thread Ondrej Pokorny
On 27.12.2019 12:01, Ondrej Pokorny wrote: On 27.12.2019 10:40, Michael Van Canneyt wrote: Yes, indeed. Therefore I suggested * TEncoding.Default for the DefaultSystemCodePage variable and * TEncoding.ANSI for the system encoding. Currently we have * TEncoding.SystemEncoding for the

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Mattias Gaertner via fpc-devel
On Fri, 27 Dec 2019 12:01:24 +0100 Ondrej Pokorny wrote: >[...] > > If I understand your reasoning correct, that should solve the > > problems you > > report ? > > Yes, that perfectly solves the issues Lazarus developers and users > face. I am OK with this solution as well. Thanks! Thank you

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Ondrej Pokorny
On 27.12.2019 10:40, Michael Van Canneyt wrote: Yes, indeed. Therefore I suggested * TEncoding.Default for the DefaultSystemCodePage variable and * TEncoding.ANSI for the system encoding. Currently we have * TEncoding.SystemEncoding for the DefaultSystemCodePage variable and * both

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Michael Van Canneyt
On Fri, 27 Dec 2019, Ondrej Pokorny wrote: On 27.12.2019 0:19, Michael Van Canneyt wrote: On Thu, 26 Dec 2019, Ondrej Pokorny wrote: On 26.12.2019 19:29, Michael Van Canneyt wrote: So no, I don't think these need to be changed/merged. What IMO can be discussed is which of these 2 need to

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Ondrej Pokorny
On 26.12.2019 23:42, Marco van de Voort wrote: Op 12/26/2019 om 9:12 PM schreef Ondrej Pokorny: In Delphi TEncoding.ANSI and TEncoding.Default are actually different. See: http://docwiki.embarcadero.com/Libraries/Rio/en/System.SysUtils.TEncoding.Default

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Ondrej Pokorny
On 27.12.2019 0:19, Michael Van Canneyt wrote: On Thu, 26 Dec 2019, Ondrej Pokorny wrote: On 26.12.2019 19:29, Michael Van Canneyt wrote: So no, I don't think these need to be changed/merged. What IMO can be discussed is which of these 2 need to be used as the default codepage in other code.

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Michael Van Canneyt
On Thu, 26 Dec 2019, Ondrej Pokorny wrote: On 26.12.2019 19:29, Michael Van Canneyt wrote: So no, I don't think these need to be changed/merged. What IMO can be discussed is which of these 2 need to be used as the default codepage in other code. It should then resolve the problems that

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Marco van de Voort
Op 12/26/2019 om 9:12 PM schreef Ondrej Pokorny: In Delphi TEncoding.ANSI and TEncoding.Default are actually different. See: http://docwiki.embarcadero.com/Libraries/Rio/en/System.SysUtils.TEncoding.Default http://docwiki.embarcadero.com/Libraries/Rio/en/System.SysUtils.TEncoding.ANSI On

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Bart via fpc-devel
On Thu, Dec 26, 2019 at 9:12 PM Ondrej Pokorny wrote: > With all the information from the docs, I am more and more convinced > that TEncoding.SystemEncoding is superfluous and TEncoding.Default > should take over its meaning: TEncoding.Default should reflect changes > in DefaultSystemCodePage.

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Ondrej Pokorny
On 26.12.2019 19:29, Michael Van Canneyt wrote: So no, I don't think these need to be changed/merged. What IMO can be discussed is which of these 2 need to be used as the default codepage in other code. It should then resolve the problems that appear, I think. That would be possible as well.

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Michael Van Canneyt
On Thu, 26 Dec 2019, Ondrej Pokorny wrote: Hello, a lot of people have a problem with the TStrings.LoadFrom*() changes when TEncoding support was added. That this was going to create problems and require code changes in user code, was clear from the start. I suggest a compromise

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Ondrej Pokorny
On 26.12.2019 17:02, Mattias Gaertner via fpc-devel wrote: On Thu, 26 Dec 2019 16:55:04 +0100 Ondrej Pokorny wrote: On 26.12.2019 16:41, Mattias Gaertner via fpc-devel wrote: On Thu, 26 Dec 2019 16:15:03 +0100 Ondrej Pokorny wrote: Hello, a lot of people have a problem with the

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Mattias Gaertner via fpc-devel
On Thu, 26 Dec 2019 16:55:04 +0100 Ondrej Pokorny wrote: > On 26.12.2019 16:41, Mattias Gaertner via fpc-devel wrote: > > On Thu, 26 Dec 2019 16:15:03 +0100 > > Ondrej Pokorny wrote: > > > >> Hello, > >> > >> a lot of people have a problem with the TStrings.LoadFrom*() > >> changes when

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Ondrej Pokorny
On 26.12.2019 16:41, Mattias Gaertner via fpc-devel wrote: On Thu, 26 Dec 2019 16:15:03 +0100 Ondrej Pokorny wrote: Hello, a lot of people have a problem with the TStrings.LoadFrom*() changes when TEncoding support was added. Currently, the no-encoding overloads of TStrings.LoadFrom*() and

Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-26 Thread Mattias Gaertner via fpc-devel
On Thu, 26 Dec 2019 16:15:03 +0100 Ondrej Pokorny wrote: > Hello, > > a lot of people have a problem with the TStrings.LoadFrom*() changes > when TEncoding support was added. > > Currently, the no-encoding overloads of TStrings.LoadFrom*() and > TStrings.SaveTo*() use the TEncoding.Default,