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

Juha Manninen juha.manninen62 at gmail.com
Wed Mar 30 11:23:49 CEST 2016

Ok, FPC had UnicodeString earlier than I remembered.
Currently WideString is often used with WinAPI when UnicodeString
should be used, as Marco reminded in another discussion.

Anyway, the problems found by Michael W. Vogel and "malcome" all deal
with constants. Assignment between variables always works thanks of
their dynamic encoding.
If there is doubt about how a constant is interpreted, it can be first
assigned to a "String" type variable which can then be typecasted to a
WinAPI's UnicodeString parameter or whatever.
In the worst case scenario an extra  "String" variable is needed.
Or, if one wants to use UnicodeString constants in a unit, he can add
{$codepage utf8}. No big deal.
IMO the problems are exaggerated.

On Wed, Mar 30, 2016 at 11:58 AM, Martin Schreiber <mse00000 at gmail.com> wrote:
> If one wants to handle BMP-chars comfortably and with good performance one has
> to convert from utf-8 in AnsiString to UnicodeString first.

Maybe, but BMP-chars are not enough for a proper Unicode support.
Besides, dealing with codepoints is the easy part regardless of
encoding. The associated problems are exaggerated again.
The true complexity of Unicode is beyond codepoints.


More information about the Lazarus mailing list