remobjects/pascalscript

Wrong char decoding with PS_NOWIDESTRING undefined

Dmitro25 opened this issue · 0 comments

Hi!
As a result of executing this code:
var c: char; begin c := #$96; end;
the variable "c" will have a value chr($3F), but not chr($96) as expected.
The reason for this is that an incorrect assignment s := tbtstring(w); (where "s" is String and "w" is WideString) is made inside "TPSPascalCompiler.ReadString" function.

This behavior is noted when the program is compiled with Delphi7 and PS_NOWIDESTRING is undefined.