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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e136d2bb18e6fb60 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-27 01:07:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!freenix!enst.fr!not-for-mail From: "Grein, Christoph" Newsgroups: comp.lang.ada Subject: Re: Character Sets Date: Wed, 27 Nov 2002 10:00:17 +0100 (MET) 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 X-Trace: avanie.enst.fr 1038388023 78459 137.194.161.2 (27 Nov 2002 09:07:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 27 Nov 2002 09:07:03 +0000 (UTC) Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: Wjdcwt9jLiVkviXuUws2OA== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc 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 X-Reply-To: "Grein, Christoph" 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:31245 Date: 2002-11-27T10:00:17+01: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); This is the full range of type Character, isn't it. > Latin_1_Char_Set : Character_Set_Type := > Str_Maps.To_Set (Span => Latin_1_Range); So this is the set of all characters. > --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); Latin_9.Euro_Sign is a name for a character. The same character in Latin1 has a different name, it is the Currency_Sign. So why do you expect this character not to be in the set only because you use a different name for it? > 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; > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada