[fpc-devel] Unicode resourcestrings
Daniël Mantione
daniel.mantione at freepascal.org
Sun Mar 2 15:31:04 CET 2008
Op Sun, 2 Mar 2008, schreef Martin Schreiber:
> On Sunday 02 March 2008 14.09:47 Daniël Mantione wrote:
>> Op Sun, 2 Mar 2008, schreef Martin Schreiber:
>>> On Sunday 02 March 2008 10.22:32 Daniël Mantione wrote:
>>>> Regarding code generation, there is a difference between ansistrings and
>>>> resourcestrings, since with a resourcestring load, the compiler must
>>>> look into the resourcestring tables to find the ansistring constant.
>>>
>>> So it is theoretical possible to call "fpc_ResourceStr_To_WideStr"
>>> instead of fpc_AnsiStr_To_WideStr if the source is a resourcestring?
>>
>> These kind of routines are called by the code generator part that does a
>> type conversion. As there is no type conversion, no such routine can be
>> called. I'm not stating it is theoretically impossible, just stating that
>> the normal type conversion mechanism cannot be used.
>>
> 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.
Daniël
More information about the fpc-devel
mailing list