View Issue Details

IDProjectCategoryView StatusLast Update
0006785FPCRTLpublic2013-04-11 08:42
ReporterPete Kosarevsky Assigned ToFlorian  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSWin32 
Fixed in Version2.0.4 
Summary0006785: crt garbles writeln() output
DescriptionSimply include "uses crt;" and your write() output is garbled.
I use russian language, win32, codepage 1251. Some symbols are substituted by question marks, some --- by other symbols.
CRT docs don't mention it openly, some other unfixed bugs don't seem to state this exact problem.
Additional InformationReporter: Pete Kosarevsky
EMail: ppkk mail dot ru
TagsNo tags attached.
Fixed in Revision
FPCOldBugId4928
FPCTarget
Attached Files

Relationships

related to 0024257 new Patch 007976 of Crt is incorrect 
related to 0016846 closedJonas Maebe Console output with unit Crt always using ANSI codepage 

Activities

2006-03-21 12:00

 

code.pp (1,020 bytes)   
I.
begin
writeln('абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ');
end.

II.
uses crt;
begin
writeln('абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ');
end.
code.pp (1,020 bytes)   

Florian

2006-05-20 23:44

administrator   ~0007810

I applied a patch from Maxim Ganetsky to fix this issue in 2.1.1. Can you please test and tell me if it works for you?

Maxim Ganetsky

2006-05-21 14:59

reporter   ~0007820

Last edited: 2006-05-21 15:01

I want to add that this patch won't work in all cases. It makes console output work on default configuration (with Terminal font), but garbles output with Lucida console font. Without this patch it is the other way round. Without Crt it will work in either case. Microsoft console is a mess ;)

But IMO it is still better than previous situation.

Florian

2006-05-21 19:03

administrator   ~0007825

I mark it as resolved for now, let's see if people still complain.

Tomas Hajny

2010-07-05 21:52

manager   ~0039045

I believe that the patch was in fact wrong and that the supplied code fragment should be rejected as not relevant for a bug report. The problem is that the provided code uses Unicode characters whereas unit Crt assumes working with traditional code pages (we may be able to change that with the Unicode string support being added recently, but that is another story). The applied patch forces all output with unit Crt to use the so called ANSI code page regardless of the code page selection performed by the user (e.g. using chcp in the particular console window before running the program or programmatically using SetConsoleCP). This is IMHO wrong. Rather than trying to reopen this bug, I'll file a new one (and link it to this one).

Issue History

Date Modified Username Field Change
2006-05-20 23:40 Florian Reporter FPC core team => Pete Kosarevsky
2006-05-20 23:40 Florian Assigned To => Florian
2006-05-20 23:40 Florian Status new => assigned
2006-05-20 23:40 Florian Additional Information Updated
2006-05-20 23:44 Florian Note Added: 0007810
2006-05-20 23:44 Florian Status assigned => feedback
2006-05-21 14:59 Maxim Ganetsky Note Added: 0007820
2006-05-21 15:01 Maxim Ganetsky Note Edited: 0007820
2006-05-21 19:03 Florian Status feedback => resolved
2006-05-21 19:03 Florian Fixed in Version => 2.0.3
2006-05-21 19:03 Florian Resolution open => fixed
2006-05-21 19:03 Florian Note Added: 0007825
2006-06-22 15:55 Florian Status resolved => closed
2010-07-05 21:52 Tomas Hajny Note Added: 0039045
2010-07-05 21:52 Tomas Hajny Relationship added related to 0016846
2013-04-11 08:42 Tomas Hajny Relationship added related to 0024257