From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2649 invoked by alias); 11 May 2003 02:56:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2631 invoked by uid 71); 11 May 2003 02:56:00 -0000 Resent-Date: 11 May 2003 02:56:00 -0000 Resent-Message-ID: <20030511025600.2629.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, bjorn_persson@sverige.nu Received: (qmail 8799 invoked by uid 48); 11 May 2003 02:47:22 -0000 Message-Id: <20030511024722.8797.qmail@sources.redhat.com> Date: Sun, 11 May 2003 02:56:00 -0000 From: bjorn_persson@sverige.nu Reply-To: bjorn_persson@sverige.nu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: ada/10738: Ada library: Only English letters are converted in Enumeration_IO. X-SW-Source: 2003-05/txt/msg01047.txt.bz2 List-Id: >Number: 10738 >Category: ada >Synopsis: Ada library: Only English letters are converted in Enumeration_IO. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun May 11 02:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: bjorn_persson@sverige.nu >Release: 3.2.3 and earlier, also snapshot 3.3-20030508 >Organization: >Environment: Redhat 7.2, Pentium 3 >Description: As a workaround for some unspecified problem, Ada.Text_IO.Enumeration_Aux contains its own To_Lower and To_Upper functions that replace those in Ada.Characters.Handling. The replacements only work for English letters, causing ugly output from Ada.Text_IO.Enumeration_IO.Put (and possibly also causing problems when reading enumeration literals). >How-To-Repeat: Compile and run this program. It should write in only lowercase letters, but writes the non-English letters in uppercase (characters 214 and 197 instead of 246 and 229). with Ada.Text_IO; use Ada.Text_IO; procedure Enum_Case_Test is type Swedish is (ombudsman, orientering, smörgåsbord); package Swedish_IO is new Ada.Text_IO.Enumeration_IO(Swedish); begin Swedish_IO.Put(Item => smörgåsbord, Set => Lower_Case); New_Line; end Enum_Case_Test; >Fix: The real fix is of course to eliminate the need for the workaround, but until then this patch should make the package follow the standard: --- gcc-3.2.3/gcc/ada/a-tienau.adb.old Sat May 4 05:27:28 2002 +++ gcc-3.2.3/gcc/ada/a-tienau.adb Sun May 11 02:44:31 2003 @@ -281,7 +281,9 @@ function To_Lower (C : Character) return Character is begin - if C in 'A' .. 'Z' then + if C in 'A' .. 'Z' or else + C in Character'Val (192) .. Character'Val (214) or else + C in Character'Val (216) .. Character'Val (222) then return Character'Val (Character'Pos (C) + 32); else return C; @@ -290,7 +292,9 @@ function To_Upper (C : Character) return Character is begin - if C in 'a' .. 'z' then + if C in 'a' .. 'z' or else + C in Character'Val (224) .. Character'Val (246) or else + C in Character'Val (248) .. Character'Val (254) then return Character'Val (Character'Pos (C) - 32); else return C; >Release-Note: >Audit-Trail: >Unformatted: