comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Reading "normal" text files with Wide_Text_IO in GNAT
Date: 30 Nov 2006 11:54:30 -0800
Date: 2006-11-30T11:54:30-08:00	[thread overview]
Message-ID: <1164916470.648544.256710@n67g2000cwd.googlegroups.com> (raw)

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




             reply	other threads:[~2006-11-30 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-30 19:54 Adam Beneschan [this message]
2006-12-03  1:22 ` Reading "normal" text files with Wide_Text_IO in GNAT Björn Persson
2006-12-04 18:17   ` Adam Beneschan
2006-12-04 23:35     ` Manuel Collado
2006-12-06 23:46       ` Björn Persson
2006-12-07  2:02         ` Adam Beneschan
2006-12-09 20:43           ` Björn Persson
2006-12-11 19:49           ` Manuel Collado
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox