[fpc-pascal] Resourcestrings in FPC 3.0

Michael Van Canneyt michael at freepascal.org
Thu Sep 24 09:00:47 CEST 2015



On Thu, 24 Sep 2015, Martin Schreiber wrote:

> On Monday 21 September 2015 11:06:53 Jonas Maebe wrote:
>> Martin Schreiber wrote on Sun, 20 Sep 2015:
>>> Are there any changes? How resourcestrings are encoded?
>>
>> Resourcestrings are stored using the same code page as constant
>> ansistrings in the source file in which they are defined (i.e.,
>> according to the rules for constant ansistrings described on
>> http://wiki.freepascal.org/FPC_Unicode_support ).
>>
> Thank you.
>
> FPC fixes_3_0 with the program
> "
> program json;
> {$codepage utf8}
> {$ifdef FPC}{$mode objfpc}{$h+}{$endif}
> {$ifdef mswindows}{$apptype console}{$endif}
> uses
> {$ifdef FPC}{$ifdef unix}cthreads,cwstring,{$endif}{$endif}
> sysutils;
> resourcestring
> a = 'aäÄ';
> begin
> end.
> "
> produces the file json.rsj
> "
> {"version":1,"strings":[
> {"hash":7200948,"name":"json.a","value":"a\u00C3\u00A4\u00C3\u0084"}
> ]}
> "
> Is this intended? How can translation tools know that the Unicode points must
> be interpreted as utf-8 code units in this case?

What did you expect to see ?

Michael.


More information about the fpc-pascal mailing list