Illegal character error for a correct declaration of a string constant
Original Reporter info from Mantis: Kryvichh
-
Reporter name:
Original Reporter info from Mantis: Kryvichh
- Reporter name:
Description:
When I try to transpile a string constant containing #$00F3, as well as any other Unicode character (> #255), Pas2js compiler produces the "Illegal character" error.
Unicode #$00F3 is the Latin Small Letter O With Acute. It is used in the Polish alphabet. My test Windows system has CP1251 as a default code page for non-Unicode programs, if it matters. CP1251 does not contain the #$00F3 Unicode character.
Steps to reproduce:
Test program:
program TestErrorIllegalChar;
const
STR_3 = #$00F3'abdef'#$017C; // TestErrorIllegalChar.dpr(3,11) Error: Illegal character
begin
Writeln('Hello, world!');
Writeln(STR_3);
end.
When I pause the debugger in function TResExprEvaluator.EvalPrimitiveExprString just before the error occurs, TResEvalString(Result).S = '?abdef'; (the first character is '?'.
Additional information:
Please see ready to test Delphi console application in the attachment.
Mantis conversion info:
- Mantis ID: 34923
- Fixed in revision: 41046.