From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:584b:b0:635:e500:8dc7 with SMTP id ml11-20020a056214584b00b00635e5008dc7mr53004qvb.4.1688248233904; Sat, 01 Jul 2023 14:50:33 -0700 (PDT) X-Received: by 2002:a05:6a00:14d6:b0:675:70d7:1eb0 with SMTP id w22-20020a056a0014d600b0067570d71eb0mr8112534pfu.6.1688248233382; Sat, 01 Jul 2023 14:50:33 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 1 Jul 2023 14:50:32 -0700 (PDT) In-Reply-To: <87edlrxqfd.fsf@nosuchdomain.example.com> Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 References: <41a5cad2-b5ca-4996-b057-e1ae8b27f526n@googlegroups.com> <87edlrxqfd.fsf@nosuchdomain.example.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <48b33023-a38e-4ccc-855e-fe6de7b12ea5n@googlegroups.com> Subject: Re: Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary? From: Kenneth Wolcott Injection-Date: Sat, 01 Jul 2023 21:50:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:65397 List-Id: On Saturday, July 1, 2023 at 2:39:06=E2=80=AFPM UTC-7, Keith Thompson wrote= : > Kenneth Wolcott writes:=20 > > On Saturday, July 1, 2023 at 1:39:30=E2=80=AFPM UTC-7, Jeffrey R.Carter= wrote:=20 > >> On 2023-07-01 19:15, Kenneth Wolcott wrote: > [...] > >> For example, if a text file is one in which all the characters, except= line=20 > >> terminators, are graphic characters, then it should be clear how to de= termine=20 > >> whether a file meets that definition of a text file.=20 > >=20 > > I think that is the definition that I'm going to pursue as the=20 > > simplest and effective definition. > Think about how you want to handle tab characters (non-graphic but=20 > common in some text) and carriage return characters (non-graphic but=20 > part of a line terminator for Windows-style text files).=20 >=20 > Also think about the various ways of representing text: ASCII, Latin-1,= =20 > UTF-8, UTF-16, etc.=20 Thanks, Keith! It looks like just need to more carefully examine the existing Ada I/O pack= ages and experiment with the possibilities... Ken