[fpc-devel] FPC 2.3.1 seems a mixed mess with Unicode support

Martin Schreiber fpmse at bluewin.ch
Wed Sep 16 10:35:17 CEST 2009


On Tuesday 15 September 2009 15:31:36 Thaddy wrote:

>
> afaik widestrings are reference counted in Delphi. PWideChars not.

According my experience, the Delphi7/Kylix3 documentation and this article:
http://edn.embarcadero.com/article/21301
"
WideStrings are now reference counted. In Windows, the Delphi WideString is 
implemented as an Ole BSTR to maximize data compatibility with OLE and 
ActiveX APIs. Ole BSTRs / WideStrings are not reference counted like Delphi 
AnsiStrings, so WideStrings tend to be a bit promiscuous in copying 
themselves all over the place. 
In Linux, there is no WideString compatibility requirement or issue, so we've 
reimplemented WideStrings to use the same copy-on-write reference count 
semantics as AnsiStrings. In fact, Kylix WideStrings use many of the same 
internal RTL support functions as AnsiStrings! How's that for code reuse!
"
you are wrong.

Martin



More information about the fpc-devel mailing list