>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: