[fpc-pascal] Unicodestrings and Assign(File)

Sven Barth pascaldragon at googlemail.com
Sat May 19 18:22:05 CEST 2012

On 19.05.2012 17:36, Marco van de Voort wrote:
> In our previous episode, Sven Barth said:
>> While I can not comment on the changes you listed (though they sound
>> more or less valid)
> I'm not sure if the *rec records can handle pointers, one probably can't use
> reference types in them, because the standard filedescriptions are
> threadvars.
> Think what happens if those are simply "cloned".

Why shouldn't reference types work in threadvard records? As long as the 
reference count mechanism does it's work correctly it should work.

In the end there will be only one way to find out: try it (even if it's 
only locally).

>> I can comment on those you didn't list: If you
>> change do_open to support Unicode you should do this for the other
>> functions (e.g. write, read) as well so that only the *W functions are
>> used for them. Also you need to keep in mind that do_open is used by
>> platform independant code so you would need to change the
>> declarations/handling for all other platforms as well. Also you need to
>> change the declaration of Assign as this expects a Short-/AnsiString.
>> Also I don't know whether the Unix users would be happy if we'd push
>> UnicodeString upon them or whether they'd prefer AnsiString(CP_UTF8).
> Probably they will be rawbytestring, so both can be passed to it, and the
> per platform code must then change it to whatever encoding (ansi,utf8,utf16)
> the API expects.

Right... forgot about that one.

>> I hope other core developers comment on this as well, as I'm not so firm
>> regarding the consequences of such changes...
> There are some interesting discussions on various lists you might want to
> read.... :-)

I know these discussions, but somehow the results/decisions (if there 
were any) got lost in the noise...


More information about the fpc-pascal mailing list