From: firewind Newsgroups: comp.os.msdos.djgpp Subject: Re: Writing a struct to disk Date: 25 Aug 1997 22:59:49 GMT Organization: Netcom Lines: 33 Message-ID: <5tt2p5$o6s@dfw-ixnews5.ix.netcom.com> References: <1 DOT 5 DOT 4 DOT 32 DOT 19970825173441 DOT 006ab780 AT dce03 DOT ipt DOT br> NNTP-Posting-Host: elp-tx2-11.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Cesar Scarpini Rabak wrote: > I've seen this affirmation several times when threads of this sort appear in > this ng. I would like to point two things: > Text format is not _that_ highly portable! When one switches from > environment the way the end of line is marked varies, and filters or > converting programms may be needed... Unlike some fortunate people, I don't have a copy of the ANSI standard handy, but in K&R2, chapter 7, section 1, is is said: "A text stream consists of a sequence of lines; each line ends with a newline character. If the system doesn't operate that way, the library does whatever is necessary to make it appear as if it does. For instance, the library might convert carriage return and linefeed to newline on input and back again on output." Someone please correct me if this is not actually garunteed by the ANSI standard. > And since C language does not require a standard character set (as e.g. Ada > which requires ASCII), one may even to use translators for the character set > as well! The only functions is C that -rely- on a certain character set are the ctype macros. If you read a character into a variable and compare it with a certain character, the comparison will correctly work for all character sets. -- [- firewind -] [- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -] [- "You're just jealous because the voices talk to -me-." -]