--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: gnat: Incorrect upper/lower case handling in Ada.Text_IO.Enumeration_IO
- From: Jacob Sparre Andersen <sparre@nbi.dk>
- Date: Wed, 22 Jun 2005 16:14:35 +0200
- Message-id: <E1Dl5zv-0005NO-F5@hugin.crs4.it>
Package: gnat
Version: 3.15p-12
Severity: normal
It appears that "Ada.Text_IO.Enumeration_IO" doesn't convert its
output correctly to lower case, when the enumeration contains
non-ISO-646 characters.
It appears that the reason for the problem is an extremely ugly hack
in "Ada.Text_IO.Enumeration_AUX". I suggest that the OS/2 specific
problems in "Ada.Characters.Handling.To_Upper" and
"Ada.Characters.Handling.To_Lower" are corrected and that the local
versions of "To_Upper" and "To_Lower" are removed from
"Ada.Text_IO.Enumeration_AUX".
* A.3.2(25) and A.3.2(26) contains the definition of lower-case and
upper-case letters.
* A.10.10(10) and A.10.10(11) explains that
Ada.Text_IO.Enumeration_IO.Put should should output in lower-case
or upper-case depending on the parameter Set.
==============================================================================
GNAT version:
GNATMAKE 3.2.2 20030222 (3.2.2-4) Copyright 1995-2001 Free Software Foundation,
Inc.
==============================================================================
Output:
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
Upper case: Ã?
Lower case: Ã?
==============================================================================
Expected output:
Upper case: Ã?
Lower case: á
Upper case: Ã?
Lower case: ð
Upper case: Ã?
Lower case: Ã
Upper case: Ã?
Lower case: ó
Upper case: Ã?
Lower case: ú
Upper case: Ã?
Lower case: ý
Upper case: Ã?
Lower case: æ
Upper case: Ã?
Lower case: ø
==============================================================================
Source code:
with Ada.Text_IO; use Ada.Text_IO;
procedure Example is
type Some_Non_ASCII_Letters is (á, ð, Ã, ó, ú, ý, æ, ø);
package Non_ASCII_Letter_Text_IO is
new Enumeration_IO (Enum => Some_Non_ASCII_Letters);
use Non_ASCII_Letter_Text_IO;
begin
for Letter in Some_Non_ASCII_Letters loop
Put (Item => "Upper case: ");
Put (Item => Letter, Set => Upper_Case);
New_Line;
Put (Item => "Lower case: ");
Put (Item => Letter, Set => Lower_Case);
New_Line;
end loop;
end Example;
==============================================================================
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-powerpc
Locale: LANG=fo_FO.ISO8859-1, LC_CTYPE=fo_FO.ISO8859-1 (charmap=ISO-8859-1)
Versions of packages gnat depends on:
ii binutils 2.15-7 The GNU assembler, linker and bina
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii libc6-dev 2.3.2.ds1-22 GNU C Library: Development Librari
ii libgnat-3.15p-1 3.15p-12 The GNU Ada 95 compiler runtime li
Versions of packages gnat recommends:
ii ada-reference-ma 20021112web-3 The standard describing the Ada 95
ii gnat-gdb 5.3.gnat.0.0.20030225-8 Ada-aware version of GDB
ii gnat-gps 2.1.0-4 The GNAT Programming System - adva
-- no debconf information
--- End Message ---