From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Assembling Complex Strings Containing Carriage Returns Prior to Using Ada.Text_IO.Put? Date: Wed, 22 Oct 2014 16:55:36 +0200 Organization: cbb software GmbH Message-ID: <16xum8oxn75uu.gepkhyd81ykl.dlg@40tude.net> References: <7c1b89e6-9ab8-4faa-b60c-c5c4683f0bff@googlegroups.com> <87d29kfwip.fsf@ludovic-brenta.org> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: zmBKEqPT3Sf8UXC8HZQYGg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:22661 Date: 2014-10-22T16:55:36+02:00 List-Id: On Wed, 22 Oct 2014 07:36:32 -0700 (PDT), Maciej Sobczak wrote: >> '\n' is not ASCII.CR, it is ASCII.LF, by the way. And on some >> nonstandard platforms, the C compiler translates '\n' into a sequence of >> two characters, ASCII.CR & ASCII.LF. > > What are those nonstandard platforms where the C compiler translates a > single character '\n' into a sequence of two characters? Maybe I/O library was meant? E.g. when opening file in text mode with fopen LF will be translated into CR-LF on Windows, or into the physical record end on VMS. > In particular, what happens in the following statement: > > const char c = '\n'; Considering some crazy platform where char is 2-bytes long, one could say that C compiler would translate '\n' and all other characters into two "proper" characters. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de