[fpc-pascal] Help making code unicode capable
Marc Weustink
marc at dommelstein.net
Sat Nov 10 17:02:35 CET 2007
Mattias Gaertner wrote:
> On Sat, 10 Nov 2007 15:44:54 +0100
> "Felipe Monteiro de Carvalho" <felipemonteiro.carvalho at gmail.com> wrote:
>
>> Thanks, I arrived at this:
>>
>> var
>> FilterBuffer: WideString;
>> ...
>>
>> FilterBuffer := Utf8Decode(Filter);
>> lpStrFilter := GetMem(Length(FilterBuffer) * 2 + 2);
>> Move(FilterBuffer, lpStrFilter, Length(FilterBuffer) * 2 + 2);
>>
>> But now it crashes when loading the dialog =/
>>
>> any ideas?
>
>
> Move(FilterBuffer[0], lpStrFilter^, Length(FilterBuffer) * 2 +
> 2);
See my other mail, I think that lpStrFilter := PWChar(FilterBuffer)
should work here. No need for a temp buffer.
Marc
More information about the fpc-pascal
mailing list