[fpc-devel] Unicode resourcestrings
Martin Schreiber
fpmse at bluewin.ch
Sun Mar 2 18:37:12 CET 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utf8resourcestring.png
Type: image/png
Size: 4173 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080302/f122da58/attachment.png>
More information about the fpc-devel
mailing list