On Sunday 02 March 2008 15.31:04 Daniël Mantione wrote:
> > Then the only possible way to use resourcestrings independent from the
> > system encoding is to compile all resource units with -Fcutf8 and to
> > write every assignment as "widestringvar:=
> > Utf8Decode(resourceconstant);"?
> > Would this method work?
>
> Yes, that method would work.
>
Does not work for me, see attachment. Compiled with -Fcutf8 on win2000 
with "ANSI" encoding.
"
const
 strco1 = 'abcäöüûôõ';
 strco2 = 'Русский';
 strco3 = 'ABCDEFG';
resourcestring
 strco1res = 'abcäöüûôõ';
 strco2res = 'Русский';
 strco3res = 'ABCDEFG';

implementation
uses
 main_mfm;
 
procedure tmainfo.test(const sender: TObject);
begin
 di1.value:= '"'+strco1+'"';
 di2.value:= '"'+strco2+'"';
 di3.value:= '"'+strco3+'"';
 di1res.value:= '"'+strco1res+'"';
 di2res.value:= '"'+strco2res+'"';
 di3res.value:= '"'+strco3res+'"';
 di1resutf8.value:= '"'+utf8decode(strco1res)+'"';
 di2resutf8.value:= '"'+utf8decode(strco2res)+'"';
 di3resutf8.value:= '"'+utf8decode(strco3res)+'"';
end;
"
What did I wrong?

Martin

<<attachment: utf8resourcestring.png>>

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to