COMP.OS.CPM-------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 1 из 100
 От   : dxforth                             2:5075/128        13 авг 23 20:45:28
 К    : Mark Ogden                                            13 авг 23 13:47:02
 Тема : Re: Aztec-C usage?
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> dc70e9e2
@REPLY:
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com> 14e5761f
@REPLYADDR dxforth <dxforth@gmail.com>
@REPLYTO 2:5075/128 dxforth
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
<kjf1ifFi86sU1@mid.individual.net> 1@dont-email.me> <878ral5vod.fsf@tilde.institute>
<874jl95u8j.fsf@tilde.institute> <fe884213-dbce-4c6f-a122-12c173f0895cn@googlegroups.com>
<c6b6bc25-67c3-4857-90d5-d2de37300ff1n@googlegroups.com> 1@dont-email.me>
<df48f126-36f2-4ec3-be4a-7ba81c3e1bcan@googlegroups.com>
@TZUTC: 1000
@PID: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:102.0) Gecko/20100101 Thunderbird/102.14.0
@TID: FIDOGATE-5.12-ge4e8b94
On 13/08/2023 5:43 pm, Mark Ogden wrote:
> On Sunday, 13 August 2023 at 04:29:01 UTC+1, dxforth wrote:
>> ...
 >> FWIW I noticed the Aztec C fgets/fprintf combo produced some
unexpected results. 
>> Unbeknown to me the source text file used included some `foreign` characters 
>> with bit 7 set. These did not pass through correctly e.g. 
>>
>> E2 80 99 
>>
>> became 
>>
>> 62 19 
>>
>> bug?
> It is not a bug.
 > Aztec C 1.06D does not have separate open modes for text and
binary, but uses special functions e.g. agetc and aputc to handle text
files.
 > Under the covers fgets calls agetc, which removes the top bit,
detects 1A as EOF and also skips null and carriage return, hence the 80h
is removed, as it becomes 0 when the top bit is removed.
 > Using fread/fwrite should avoid this, also using raw read/write
with a buffer a reasonable multiple of the sector size, would avoid too
many multiple buffer copies and should be the most performant.

 > Other compilers e.g. Hitech C, do have open modes e.g. "rt" or
"wt" to open a file as text and "rb" or "wb" to open as binary,
implementing the differences beneath the covers.

If clearing bit 7 isn`t a bug, perhaps a dubious feature :)


 --- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх