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

Juha Manninen juha.manninen62 at gmail.com
Thu Mar 31 15:47:24 CEST 2016

On Thu, Mar 31, 2016 at 4:25 PM, Bart <bartjunk64 at gmail.com> wrote:
> in this scenario adding {$codepage utf8} may be the wise thing to do:
> it eliminates all confusion about the intended encoding of the string constant.

How is a conversion to UTF-16 and then back to UTF-8 less confusing
than a direct copy without conversions?

> When you use UnicodeString everywhere and no AnsiString anywhere, then
> the only confusion left is Endianess,or am I (as one of the Universes
> idiots) oversimplifying here.

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.

Bart, were your earlier results caused by NOT using the new Unicode support?
I am surprised if that is the case.
The whole discussion was about the new Unicode support and you have
been testing it since the beginning.


More information about the Lazarus mailing list