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-Thread: 103376,5d4095813b818c7d,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!n67g2000cwd.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Reading "normal" text files with Wide_Text_IO in GNAT Date: 30 Nov 2006 11:54:30 -0800 Organization: http://groups.google.com Message-ID: <1164916470.648544.256710@n67g2000cwd.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1164916476 21188 127.0.0.1 (30 Nov 2006 19:54:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Nov 2006 19:54:36 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: n67g2000cwd.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:7760 Date: 2006-11-30T11:54:30-08:00 List-Id: I was looking in the GNAT reference manual at the description of the WCEM Form parameter to Wide_Text_IO.Open. It describes the different ways that wide characters can be represented in text files that Wide_Text_IO can interpret. However, at first glance, I didn't see a way to get Wide_Text_IO to read a UCS-1 text file. This is the encoding where each byte in the range 16#00#..16#FF# represents a character in the range Wide_Character'Val(16#0000#) .. Wide_Character'Val(16#00FF#), and there is no way to represent wide characters from 16#0100# to 16#FFFF#. In other words, a boring old-fashioned 8-bit text file, maybe with Latin-1 characters or control characters in the 80..9F range. Yes, I know that a file like this could be read using Text_IO, but let's say that we don't know what format the file is in until runtime. Does GNAT's Wide_Text_IO have a way to read a file like this? -- thanks, Adam