inconsistent const codepage
Original Reporter info from Mantis: ajax16384
-
Reporter name:
Original Reporter info from Mantis: ajax16384
- Reporter name:
Description:
single char RawByteString const has wrong codepage.
Steps to reproduce:
program bug;
{$IFDEF FPC}
{$CODEPAGE UTF8}
{$ENDIF}
const
c0: RawByteString = '';
c1: RawByteString = 'a';
c2: RawByteString = 'aa';
c3: RawByteString = 'aaa';
begin
writeln(StringCodePage(c0));
writeln(StringCodePage(c1));
writeln(StringCodePage(c2));
writeln(StringCodePage(c3));
end.
1252 // for empty strings CP_ACP - OK
65535 // Wrong!
65001 // OK
65001 // OK
FYI
DCC32.EXE --codepage:65001 -cc bug.pas
1252 // OK
65001 // OK
65001 // OK
65001 // OK
Mantis conversion info:
- Mantis ID: 29153
- Platform: windows
- Version: 3.0.0
- Fixed in version: 3.1.1
- Fixed in revision: 32636 (#092a0af0)
- Monitored by: » luizamerico (Luiz Americo)
- Target version: 3.0.2