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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!enea!sommar From: sommar@enea.UUCP Newsgroups: comp.lang.ada Subject: Characters with codes >= 128 Message-ID: <2231@enea.UUCP> Date: Sun, 30-Aug-87 17:28:05 EDT Article-I.D.: enea.2231 Posted: Sun Aug 30 17:28:05 1987 Date-Received: Tue, 1-Sep-87 04:16:53 EDT Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.lang.ada Organization: ENEA DATA Svenska AB, Sweden List-Id: 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