[fpc-devel] Controlling the output of the widestring manager

Marc Weustink marc at dommelstein.net
Mon Dec 3 00:48:38 CET 2007


Florian Klaempfl wrote:
> Marc Weustink schrieb:
>> Florian Klaempfl wrote:
>>> Marc Weustink schrieb:
>>>> Florian Klaempfl wrote:
>>>>> Felipe Monteiro de Carvalho schrieb:
>>>>>> On Dec 2, 2007 1:04 AM, Marc Weustink <marc at dommelstein.net> wrote:
>>>>>>>  From the logs I understand that there is a "real" managed utf8string
>>>>>>> type (other than utf8string = type string).
>>>>>> No, currently utf8string = type string is about all support
>>>>>> implemented for such type.
>>>>>>
>>>>> Indeed, patches for a utf8string unit are welcome ;)
>>>> Waht kind of patches are needed ? 
>>> No idea :) Lazarus complained that things are missing.
>>>
>>>> I just happen to notice that someone
>>>> is adding unicodestring support ;)
>>>> would this be a replacemnt for the utf8strng ?.
>>> No. It will be an utf-16 string. On non windows unicodestring=widestring
>> Aahh... the wide string as the widestring should have been on windows.
>> I got confused, since UTF8 is unicode too :)
>>
>>
>> Anyway, what I think for Lazarus is need is:
>> A) a transparent way of assigning from/to other stringtypes,
>> (shortstring/widestring/ansistring), where under the hood the contents
>> is converted.
>> B) a transparent way of passing as param of other stringtypes,
>> (shortstring/widestring/ansistring), where under the hood the contents
>> is converted.
>> C) a way of specifying the default type of the string type, to allow
>> easier converiosn of existing codebases
>>
>> ad A: From what I have seen with type UTF8String = type ansistring it is
>> not possible to do with operator overloading since both types utf8string
>> and ansistring are considered the same
> 
> This can be enabled.
> 
>> ad B: there is no operator for this, so it acnt be overloaded

And what about this one ?

will the following code be possible ?

procedure Foo(const S: Utf8String);
begin
end;

var
   X: ANsiString;
begin
   Foo(X);
end.

Will the correct conversion be called to be able to convert X to a 
Utf8String ? (or will this be handled by the := operator ?)

What about C ?

Marc




More information about the fpc-devel mailing list