Error reading char in stdio.LockingTextReader.takeFront()

MGW via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 28 05:36:07 PDT 2015


I think that found an error in the stdio module.
When reading the file consisting of entries in the coding UTF-8, 
type:

.......
16235;Иванов;Петр;Петрович;17.09.1961
8765;Петров;Иван;Васильевич;25.12.1978
.......

total quantity of records about 30000

there are errors: invalid secuence Utf-8

Research of a problem showed that results failure from reading 
from the buffer of the next character the FGETC function 
(cast(_iobuf*)_f. _ p.handle) in the takeFront procedure. And, 
over time failure happens only provided that characters return to 
the (cast(_iobuf*)_f. _ p.handle) the ungetc() function. If it is 
simple to realize reading characters, without returning them the 
ungetc function(), this error isn't shown. For example it was 
absent in the dmd 2.066 version where in stdio.d the ungetc 
function wasn't used().


More information about the Digitalmars-d mailing list