[Lazarus] UTF8 RTL for Windows

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Nov 24 14:19:25 CET 2014


Michael Schnell schrieb:
> On 11/23/2014 07:52 PM, Felipe Monteiro de Carvalho wrote:
>>
>> Well, the first reports of how the unicode rtl would look like were
>> pretty scary: Total break of the string part of millions of lines of
>> code that people wrote with Lazarus since years.
>>
> That is why I stopped recommending Lazarus to my colleagues who are 
> doing Delphi.
> 
> They took a huge amount of pain to convert their software from Delphi 
> one byte strings to Delphi two bytes strings.

I had similar problems, but only in porting a huge codebase from 
ShortString to AnsiString. The move from D5 to XE was painless then, 
only the uses lists deserved some updates. In so far it might be a good 
idea to educate some old-school Delphi coders, how to deal with managed 
strings and other past-BP items in general.

As for Lazaurs, I think that UTF-8 is the best choice for multi-platform 
projects, with almost no extra conversions required on any platform.
Please note that until now Windows did the Ansi to UTF conversions 
itself, in every API call with strings involved. If this was not noticed 
before, the conversions won't be noticeable afterwards as well.

A move to UTF-16 instead will only favor Windows, while additional 
string conversions will be required on almost every other platform. I 
think that FPC/Lazarus should fork and support separate libraries 
(RTL...) for UTF-8 and UTF-16 strings, if compatibility with newer 
Delphi VCL projects is desired. Full Delphi compatibility would also 
require a FireMonkey replacement for the LCL, and that were another very 
new project, extending the UTF-16 branch (only).

Just my 0.02€
DoDi





More information about the Lazarus mailing list