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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC,TVD_SPACE_RATIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e136d2bb18e6fb60,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-26 13:42:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: Character Sets Date: Tue, 26 Nov 2002 13:41:48 -0800 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1038346924 76244 137.194.161.2 (26 Nov 2002 21:42:04 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 26 Nov 2002 21:42:04 +0000 (UTC) Return-Path: X-Envelope-From: rleif@rleif.com X-Envelope-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:31238 Date: 2002-11-26T13:41:48-08:00 From: Bob Leif I am trying to test if a character is not in the Latin_1 character set. I choose the Euro because it is in Latin_9 and not in Latin_1. I tested the function Ada.Strings.Maps.Is_In. It returns that the Euro_Sign is in the Latin_1 character set. What have I done wrong? My test program, which compiled and executed under GNAT 3.15p under Windows XP, produced: ------------------------Starting Test----------------------- Is_In_Character_Set is TRUE ------------------------Ending Test----------------------- The test program is as follows: --------------------------------------------------------- with Ada.Text_Io; with Ada.Io_Exceptions; with Ada.Exceptions; with Ada.Strings; with Ada.Strings.Maps; with Ada.Characters.Latin_1; with Ada.Characters.Latin_9; procedure Char_Sets_Test is ------------------Table of Contents------------- package T_Io renames Ada.Text_Io; package Str_Maps renames Ada.Strings.Maps; package Latin_1 renames Ada.Characters.Latin_1; package Latin_9 renames Ada.Characters.Latin_9; subtype Character_Set_Type is Str_Maps.Character_Set; -----------------End Table of Contents------------- Latin_1_Range : constant Str_Maps.Character_Range := (Low => Latin_1.Nul, High => Latin_1.Lc_Y_Diaeresis); Latin_1_Char_Set : Character_Set_Type := Str_Maps.To_Set (Span => Latin_1_Range); --Standard for Ada '95 Is_In_Character_Set : Boolean := False; --------------------------------------------- begin--Bd_W_Char_Sets_Test T_Io.Put_Line("-----------------------Starting Test--------------------); --------------------------------------------- --Test Character_Sets Is_In_Character_Set:=Ada.Strings.Maps.Is_In ( Element => Latin_9.Euro_Sign, Set => Latin_1_Char_Set); T_Io.Put_Line("Is_In_Character_Set is " & Boolean'Image (Is_In_Character_Set)); --------------------------------------------- --------------------------------------------- T_Io.Put_Line("-----------------------Ending Test----------------------); exception when A: Ada.Io_Exceptions.Status_Error => T_io.Put_Line("Status_Error in Char_Sets_Test."); T_Io.Put_Line(Ada.Exceptions.Exception_Information(A)); when O: others => T_Io.Put_Line("Others_Error in Char_Sets_Test."); T_Io.Put_Line(Ada.Exceptions.Exception_Information(O)); end Char_Sets_Test;