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

Bart bartjunk64 at gmail.com
Thu Mar 31 16:20:10 CEST 2016


On 3/31/16, Juha Manninen <juha.manninen62 at gmail.com> wrote:

> I doubt you will change every "String" into "UnicodeString" in your code.
> Somehow you missed the fundamental idea of our new Unicode system.
> "String" has Unicode and you don't need to care about it, or even
> about endianess.
> Delphi reaches the same goal by mapping String -> UnicodeString.
> When you need Ansi codepages then you need to pay attention obviously,
> otherwise not.

In my fantasy scenario the String would of course have the meaning of
UnicodeString.

> Bart, were your earlier results caused by NOT using the new Unicode
> support?
The tests I posted in this thread were plain fpc programs, so no use of LazUtf8.
It pointed out that the Lazarus part of the wiki (Better Unicode
support) could be interpreted wrong.

> The whole discussion was about the new Unicode support and you have
> been testing it since the beginning.

I have use the "Utf8 in RTL" ever since i swithed to the 3.0 compiler
(I have to admit I was to scared to test the 2.7 branch, but I started
with the first 3.0 RC), and the number of bugs we had to fix was far,
far less than I thought it would be.

Most of my own programs seem to require no change at all.
The main excpetion being my backupprogram, but not beause it stopped
correctly accessing filenames with unicode cahracter in their path,
but because I used a procedural paramter in it's engine, for which now
the signature had changed from plain string to either RawByteString or
UnicodeString.
All this was solved (with ifdefs for the 2.6 compiler) quit easily.

And as I pointed out to you earlier in another thread in the forum,
the "new UTF8 system" works even better than I thought.

Then again, I do not use databases in any of my programs, so I don't
have to deal with that part of the problem.
All my textual data is stored in plain textfiles in UTF8 encoding,
probably from the day I started using Lazarus as my main platform
(0.9.16).

Anyhow, it's a fascinating issue, and the more I understand about it,
the better I am able to fix encoding related problems in our (or
user's) code.

Bart




More information about the Lazarus mailing list