Reproduceable unicode bug

Anu de DeusAnu de Deus Hampshire, UK
edited 7:06PM in FastReport 4.0
When accessing a variable value from the script, which holds a Russian string, the value is ok if you read it directly.
But if you pass it as a parameter to a function inside the same script, it loses its widestrings capabilities and the result is a widestring to ansistring conversion gone wrong.

Try this (or simply open my attached report sample):
Create a new form, just drop a FRXreport and frxDesigner on it, open the report designer.
Add a variable (named 'var1'), which holds a Russian word, like 'Умолчание'. And a memoview object on the page. Added a onbeforeprint event in the script, like this:
function GetParameterFromSender: string;
begin
  result := get('var1');   
end;

procedure memo1OnBeforePrint(Sender: TfrxComponent);
var                                                                
  lStr1, lStr2 : string;
begin
    lstr1 := GetParameterFromSender;
    lstr2 := get('var1');

// lstr1 now has '??????????', because it called GetParameterFromSender to get the value.
// lstr2 now has 'Умолчание', as it used get() directly

    showmessage(lStr1); 
    showmessage(lstr2); 
end;

begin
end.

Clearly, to me, the function call is unable to keep the widestring value internally. As far as I know, that's the only problem with unicode in my entire report/application.

Please note that my Vista 32 bits has the Russian language installed, but the Windows setting for 'Language for non-unicode programs' is English. I need to keep it this way as that's what my customers have. In any case, a true widestrings/Unicode application should not need this to be changed (like a FR app).
I got the latest FR daily build, 4.10.6, and Delphi 2010.
If you cannot reproduce the error, please set your 'Language for non-unicode programs' to English and verify (after rebooting).
Does anyone else have this problem, and know a work around it?
(I opened a support ticket for this, but so far, no replies)

Thanks in advance,
Alex

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.