[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#63717: marked as done (isalpha()/toupper() functions do not work for non-ASCII characters)



Your message dated Mon, 8 May 2000 13:52:33 -0400
with message-id <20000508135232.A29151@drow.res.cmu.edu>
and subject line [gaia@iki.fi: Bug#63717: isalpha()/toupper() functions do not work for non-ASCII characters]
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 7 May 2000 16:08:26 +0000
Received: (qmail 19776 invoked from network); 7 May 2000 16:08:25 -0000
Received: from gnu.in-berlin.de (192.109.42.4)
  by master.debian.org with SMTP; 7 May 2000 16:08:25 -0000
Received: from hirsch.in-berlin.de (root@hirsch.in-berlin.de [192.109.42.6])
	by gnu.IN-Berlin.DE (8.9.3/8.9.3) with ESMTP id SAA10770
	for <submit@bugs.debian.org>; Sun, 7 May 2000 18:08:24 +0200 (CEST)
	(envelope-from jroger.in-berlin.de!srittau@hirsch.in-berlin.de)
Received: by hirsch.in-berlin.de (Smail3.2)
	  id <m12oTbT-000ghKC>; Sun, 7 May 2000 18:08:23 +0200 (CEST)
Received: from srittau by moby.jroger.in-berlin.de with local (Exim 3.12 #1 (Debian))
	id 12oTXH-0002Ch-00; Sun, 07 May 2000 18:04:03 +0200
From: srittau <srittau@jroger.in-berlin.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: isalpha()/toupper() functions do not work for non-ASCII characters
X-Reportbug-Version: 0.54
X-Mailer: reportbug 0.54
Date: Sun, 07 May 2000 18:04:03 +0200
Message-Id: <[🔎] E12oTXH-0002Ch-00@moby.jroger.in-berlin.de>

Package: libc6
Version: 2.1.3-10
Severity: normal

The is*() and toupper()/tolower() functions do not work on non-ASCII
characters, even if LC_CTYPE etc. are set to the correct language used:

-----------------------------------------------------------------------

srittau@moby:~$ locale
LANG=de_DE
LC_CTYPE="de_DE"
LC_NUMERIC="de_DE"
LC_TIME="de_DE"
LC_COLLATE="de_DE"
LC_MONETARY="de_DE"
LC_MESSAGES="de_DE"
LC_ALL=
srittau@moby:~$ cat try.c
#include <ctype.h>
#include <stdio.h>

int main()
{
  int c = 'ä';
  printf("%c: %d\n", c, isprint(c));

  return 0;
}
srittau@moby:~$ gcc try.c -o try -Wall
srittau@moby:~$ ./try 
ä: 0
srittau@moby:~$ 

-----------------------------------------------------------------------

ä is a valid printing character, especially in the german language
(LANG=de_DE).

-- System Information
Debian Release: 2.2
Architecture: i386
Kernel: Linux moby 2.3.99-pre3 #1 Son Apr 2 11:15:37 CEST 2000 i686

Versions of packages libc6 depends on:
ii  ldso                          1.9.11-8   The Linux dynamic linker, library 


---------------------------------------
Received: (at 63717-done) by bugs.debian.org; 8 May 2000 17:52:34 +0000
Received: (qmail 19460 invoked from network); 8 May 2000 17:52:34 -0000
Received: from drow.res.cmu.edu (mail@128.2.160.32)
  by master.debian.org with SMTP; 8 May 2000 17:52:34 -0000
Received: from drow by drow.res.cmu.edu with local (Exim 3.12 #1 (Debian))
	id 12orhp-0007aa-00; Mon, 08 May 2000 13:52:33 -0400
Date: Mon, 8 May 2000 13:52:33 -0400
From: Daniel Jacobowitz <dan@debian.org>
To: 63717-done@bugs.debian.org
Subject: [gaia@iki.fi: Bug#63717: isalpha()/toupper() functions do not work for non-ASCII characters]
Message-ID: <20000508135232.A29151@drow.res.cmu.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.1.9i

Saving Joel the work...

----- Forwarded message from Antti-Juhani Kaijanaho <gaia@iki.fi> -----

Date: Mon, 8 May 2000 10:32:46 +0300
From: Antti-Juhani Kaijanaho <gaia@iki.fi>
Subject: Bug#63717: isalpha()/toupper() functions do not work for non-ASCII characters
To: srittau <srittau@jroger.in-berlin.de>, 63717@bugs.debian.org
Reply-To: Antti-Juhani Kaijanaho <gaia@iki.fi>, 63717@bugs.debian.org

On Sun, May 07, 2000 at 06:04:03PM +0200, srittau wrote:
> The is*() and toupper()/tolower() functions do not work on non-ASCII
> characters, even if LC_CTYPE etc. are set to the correct language used:

Yes they do.

> srittau@moby:~$ locale
> LANG=de_DE
> LC_CTYPE="de_DE"
> LC_NUMERIC="de_DE"
> LC_TIME="de_DE"
> LC_COLLATE="de_DE"
> LC_MONETARY="de_DE"
> LC_MESSAGES="de_DE"
> LC_ALL=
> srittau@moby:~$ cat try.c
> #include <ctype.h>
> #include <stdio.h>
> 
> int main()
> {
>   int c = 'ä';
>   printf("%c: %d\n", c, isprint(c));
> 
>   return 0;
> }
> srittau@moby:~$ gcc try.c -o try -Wall
> srittau@moby:~$ ./try 
> ä: 0
> srittau@moby:~$ 

This is expected behaviour.  In the absence of a "setlocale" call the
program's locale is C.  To use the locale settings from the environment,
call setlocale(LC_ALL, "").  Observe:

$ locale
LANG=fi_FI
LC_CTYPE="fi_FI"
LC_NUMERIC="fi_FI"
LC_TIME="fi_FI"
LC_COLLATE="fi_FI"
LC_MONETARY="fi_FI"
LC_MESSAGES="fi_FI"
LC_ALL=
$ cat try-orig.c
#include <ctype.h>
#include <stdio.h>

int main()
{
  int c = 'ä';
  printf("%c: %d\n", c, isprint(c));

  return 0;
}
$ gcc try-orig.c -o try-orig -Wall
$ ./try-orig 
ä: 0
$ cat try.c
#include <ctype.h>
#include <locale.h>
#include <stdio.h>

int main()
{
  int c = 'ä';
  setlocale(LC_ALL, "");
  printf("%c: %d\n", c, isprint(c));

  return 0;
}
$ gcc try.c -o try -Wall
$ ./try
ä: 16384
$ 

This behaviour is (AFAIK) described in the ISO C standards, and in the
setlocale(3) manual page.

To the maintainer: you may close this bug.

-- 
%%% Antti-Juhani Kaijanaho % gaia@iki.fi % http://www.iki.fi/gaia/ %%%

                    I'm moving IRL on May 2, 2000.
               New contact information on the home page


--  
To UNSUBSCRIBE, email to debian-glibc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



----- End forwarded message -----


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/


Reply to: