wxTextFile and EOF
Manuel Martín
mmartin at ceyd.es
Mon Dec 10 11:20:11 PST 2007
>>>
>>> What do you mean by this exactly? Does the fourth line contain ASCII ^Z
>>> character or something else?
>>>
>> I mean 0x1A char on fourth line.
>
> Is it 0x0A? If so that's the line-feed character, and on *nix systems
> that corresponds to the \n. If the file was created on an DOS based
> system in text mode then the \n would be a combination of
> carriage-return and line-feed characters, and you would see 0x0D 0x0A in
> the hex dump.
>
On hex dump I can see 0x0D 0x0A at the end of the first 3 lines.
wxTextFile reads them the way I like, breaking file into lines
despite of DOS, *nix or Mac end-of-line mode :)
But because using old files, 0x1A is the only char in fourth line.
It isn't any of end-of-line chars used, so wxTextFile adds it as
a fourth line (last line is not necessary ending with 0x0A).
My question arises from 0x1A was a end-of-file char used some years
ago, and I need to deal with it.
gVim doesn't show this char neither in "normal view" nor when I
switch to hex-view, so I suppose gVim understands it and shows
n= bytesOfFile - 1 bytes on 3 lines. But wxTextFile shows 4 lines
and that's why my surprise.
TIA
Manolo
More information about the wx-users
mailing list