Mail Archives: djgpp/1997/08/25/21:49:48
Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br> 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-." -]
- Raw text -