remobjects / pascalscript

pascalscript
Other
447 stars 178 forks source link

Wrong char decoding with PS_NOWIDESTRING undefined #237

Open Dmitro25 opened 4 years ago

Dmitro25 commented 4 years ago

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.