Mattias Gaertner wrote:
On Sat, 10 Nov 2007 15:44:54 +0100
"Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote:
Thanks, I arrived at this:
var
FilterBuffer: WideString;
...
FilterBuffer := Utf8Decode(Filter);
lpStrFilter := GetMem(Length(FilterBuffer) * 2 + 2);
Move(Fi
Felipe Monteiro de Carvalho wrote:
Hello,
I have a small piece of code on LCL which I have found hard to convert
to unicode:
lpStrFilter := StrAlloc(Length(Filter)+1);
StrPCopy(lpStrFilter, Filter);
There is a big chance that this is an inheritence of the pre 1.0 fpc
times. At th
On Nov 10, 2007 3:54 PM, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
>Move(FilterBuffer[0], lpStrFilter^, Length(FilterBuffer) * 2 +
> 2);
The compiler wisely doesn't allow accessing [0], but:
Move(FilterBuffer[1], lpStrFilter^, Length(FilterBuffer) * 2 + 2);
Seams to work perfectl
On Sat, 10 Nov 2007 15:44:54 +0100
"Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote:
> Thanks, I arrived at this:
>
> var
> FilterBuffer: WideString;
> ...
>
> FilterBuffer := Utf8Decode(Filter);
> lpStrFilter := GetMem(Length(FilterBuffer) * 2 + 2);
> Move(FilterBuffe
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?
than
On 10 Nov 2007, at 15:24, Felipe Monteiro de Carvalho wrote:
utf8decode returns string I assume?
It returns WideString. Is there a function to manually alloc a
widestring like StrAlloc?
Assign it to a variable of the type widestring. If you cannot this
variable in scope the whole time, yo
> utf8decode returns string I assume?
It returns WideString. Is there a function to manually alloc a
widestring like StrAlloc?
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailma
> On 10 Nov 2007, at 15:08, Felipe Monteiro de Carvalho wrote:
>
> > Having a win9x version is trivial, but having a version where we put a
> > PWideChar into lpStrFilter looks hard...
> >
> > lpStrFilter := StrAlloc(Length(Filter)+1);
> > StrPCopy(lpStrFilter, Utf8ToAnsi(Filter));
> >
>
On 10 Nov 2007, at 15:08, Felipe Monteiro de Carvalho wrote:
Having a win9x version is trivial, but having a version where we put a
PWideChar into lpStrFilter looks hard...
lpStrFilter := StrAlloc(Length(Filter)+1);
StrPCopy(lpStrFilter, Utf8ToAnsi(Filter));
I tryed this as unicode