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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ea7ac816f5c3d0a7,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-24 13:32:42 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: adam@irvine.com (Adam Beneschan) Newsgroups: comp.lang.ada Subject: Wide_Text_IO: bad data in text file Date: 24 Oct 2002 13:32:42 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 66.126.103.122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1035491562 25264 127.0.0.1 (24 Oct 2002 20:32:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 24 Oct 2002 20:32:42 GMT Xref: archiver1.google.com comp.lang.ada:30111 Date: 2002-10-24T20:32:42+00:00 List-Id: Question: When Wide_Text_IO.Get is used to read a character or string from the text file, and the file contains a sequence of bits that cannot be interpreted as a character or string, does the language specify what exception, if any, should be raised? Or is it implementation-dependent? This isn't really a problem with Text_IO. For Wide_Text_IO, though, it's likely that the file will be read using a specific encoding scheme, such as UTF-8; and it is possible for the file to contain 8-bit bytes that do not represent legal encodings in UTF-8 (or other encoding scheme). The RM doesn't specifically address this issue, as far as I can tell. Data_Error seems to be intended for cases where characters can be read from the file but they're not in the proper syntax for an integer (when using an instance of Integer_IO), or a float, or whatever. The closest thing I could find was A.13(10), which says "Use_Error is propagated if an operation is attempted that is not possible for reasons that depend on characteristics of the external file". When I tried a test using GNAT, it raised Constraint_Error, which seems counterintuitive. Comments? -- thanks, Adam