comp.lang.ada
 help / color / mirror / Atom feed
From: sommar@enea.UUCP
Subject: Characters with codes >= 128
Date: Sun, 30-Aug-87 17:28:05 EDT	[thread overview]
Date: Sun Aug 30 17:28:05 1987
Message-ID: <2231@enea.UUCP> (raw)


I'd like to write a programme that can handle text which contains
characters from an extented ASCII set for covering national 
characters. The LRM seems to totally disregard this, since it
states that the character type is ASCII with 128 possible values.
Also, Ada only allows you to have printable characters within
strings. And printable is defined as the range ' '..'~'. 
  Easy, you might say. Just define a new character type. How?
I can't have quoted strings for the new characters, since they
are "non-printing". I can't extend the ASCII package (in STANDARD),
since it relies on that the character type is already defined.
  And even if I succeed somhow, how to with Text_io? Will the 
compiler accept attempt to give Text_io the new character type,
even if it's called "character"? Hardly.
  Have I missed someting? I hope. If not, THIS IS A VERY SERIOUS
RESTRICTION IN ADA.

I should add that to some extent it is possible to handle these
characters. My Ada system (Verdix 5.2A for VAX/Unix) doesn't mind
if I read an extended character from a file or if I try to write
it. Character'val(ch) on the character returns the correct code.
But Character'pos(Character'val(ch)) raises Contraint_error if
ch is from the upper half.
  But this only a little. I want string constants in my programme,  
it's dead. What do? Read them from a file at start-up? :-)
-- 

Erland Sommarskog       
ENEA Data, Stockholm    
sommar@enea.UUCP        

             reply	other threads:[~1987-08-30 21:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-08-30 21:28 sommar [this message]
1987-09-02 14:24 ` Characters with codes >= 128 stt
  -- strict thread matches above, loose matches on Subject: below --
1987-08-31 20:47 "MARTIN J. MOORE"
1987-09-02  2:35 OCharacters " colbert
1987-09-05 20:43 ` Characters " sommar
1987-09-09 13:29 Jim Moody, DCA C342
1987-09-10  3:47 colbert
1987-09-10 18:39 ` Barry Margolin
1987-09-12 14:47 ` Erland Sommarskog
1987-09-10 12:51 "MARTIN J. MOORE"
1987-09-14 14:28 characters " Jim Moody, DCA C342
1987-09-15 20:55 ` Erland Sommarskog
replies disabled

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