[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?

Marcos Douglas md at delfire.net
Fri Dec 27 21:25:52 CET 2013


On Fri, Dec 27, 2013 at 10:15 AM, Graeme Geldenhuys
<graeme at geldenhuys.co.uk> wrote:
> On 2013-12-27 09:16, Hans-Peter Diettrich wrote:
>> But
>> when "string" becomes UTF-16, as in recent Delphi versions, Lazarus and
>> the LCL deserves heavy refactoring. That's the top discussion topic
>> right now.
>
> Personally I think FPC and Lazarus should get rid of "string"
> altogether! It should be a user definable type that can be defined per
> project.
>
> eg:
> Projects could do the following
>
>   type
>     {$IFDEF WINDOWS}
>     UnicodeString = UTF16String
>     {$ENDIF}
>     {$IFDEF UNIX}
>     UnicodeString = UTF8String
>     {$ENDIF}
>
>    String = UnicodeString
>    // or for backwards compatibility with old projects:
>    //   String = AnsiString
>
> or they could simply say they prefer to work with a specific encoding,
> so use UTF16String or UTF8String directly. Thus no alias type needed.
>
> [...]

+1

Marcos Douglas




More information about the Lazarus mailing list