Bug#799856: libc6: strftime doesn't honor the charmap

2015-10-01 Thread Vincent Danjean
Le 23/09/2015 12:17, Vincent Lefevre a écrit :
> Package: libc6
> Version: 2.19-22
> Severity: normal
> 
> strftime doesn't honor the charmap. The following shows that strftime
> yields ISO-8859-1 characters while the charmap is UTF-8.
> 
> $ locale
> LANG=POSIX
> LANGUAGE=
> LC_CTYPE=en_US.UTF-8
> LC_NUMERIC="POSIX"
> LC_TIME=fr_FR

  ^
LC_TIME is set to fr_FR, that is latin1.
If LC_TIME is set to fr_FR.utf8, I cannot observe the problem anymore.

$ LC_TIME=fr_FR date -d 2015-02-07 +%b | hexdump -C
  66 e9 76 72 2e 0a |f.vr..|
0006
$ LC_TIME=fr_FR.utf8 date -d 2015-02-07 +%b | hexdump -C
  66 c3 a9 76 72 2e 0a  |f..vr..|
0007

  If you agree with me, I let you close the bug.

  Regards,
Vincent

-- 
Vincent Danjean   GPG key ID 0xD17897FA vdanj...@debian.org
GPG key fingerprint: 621E 3509 654D D77C 43F5  CA4A F6AE F2AF D178 97FA
Unofficial pkgs: http://moais.imag.fr/membres/vincent.danjean/deb.html
APT repo:  deb http://people.debian.org/~vdanjean/debian unstable main



Bug#799856: libc6: strftime doesn't honor the charmap

2015-10-01 Thread Vincent Lefevre
On 2015-10-01 22:37:43 +0200, Vincent Danjean wrote:
> Le 23/09/2015 12:17, Vincent Lefevre a écrit :
> > Package: libc6
> > Version: 2.19-22
> > Severity: normal
> > 
> > strftime doesn't honor the charmap. The following shows that strftime
> > yields ISO-8859-1 characters while the charmap is UTF-8.
> > 
> > $ locale
> > LANG=POSIX
> > LANGUAGE=
> > LC_CTYPE=en_US.UTF-8
> > LC_NUMERIC="POSIX"
> > LC_TIME=fr_FR
> 
>   ^
> LC_TIME is set to fr_FR, that is latin1.
> If LC_TIME is set to fr_FR.utf8, I cannot observe the problem anymore.
> 
> $ LC_TIME=fr_FR date -d 2015-02-07 +%b | hexdump -C
>   66 e9 76 72 2e 0a |f.vr..|
> 0006
> $ LC_TIME=fr_FR.utf8 date -d 2015-02-07 +%b | hexdump -C
>   66 c3 a9 76 72 2e 0a  |f..vr..|
> 0007
> 
>   If you agree with me, I let you close the bug.

I disagree. The charmap is specified by LC_CTYPE, not by LC_TIME.
See the locale(7) man page:

  LC_CTYPE
This category determines the interpretation of byte sequences
as characters (e.g., single versus multibyte characters), [...]

  LC_TIME
This category governs the formatting used for date and time
values. For example, most of Europe uses a 24-hour clock
versus the 12-hour clock used in the United States. [...]

So, the charmap part of the locale value of LC_TIME should be ignored,
just like it is for LC_MESSAGES (with LC_MESSAGES=fr_FR in a UTF-8
environment, messages are output in UTF-8, even though fr_FR is
latin1).

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#799856: libc6: strftime doesn't honor the charmap

2015-09-23 Thread Vincent Lefevre
Package: libc6
Version: 2.19-22
Severity: normal

strftime doesn't honor the charmap. The following shows that strftime
yields ISO-8859-1 characters while the charmap is UTF-8.

$ locale
LANG=POSIX
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="POSIX"
LC_TIME=fr_FR
LC_COLLATE=POSIX
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ locale charmap
UTF-8
$ date -d 2015-02-07 +%b
f�vr.
$ date -d 2015-02-07 +%B
f�vrier
$ date -d 2015-02-07 +%B | hd
  66 e9 76 72 69 65 72 0a   |f.vrier.|
0008

Note that there is no such problem with LC_MESSAGES, e.g.:

$ LC_MESSAGES=fr_FR cp
cp: opérande de fichier manquant
Saisissez « cp --help » pour plus d'informations.

is UTF-8 as expected.

-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.1.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6 depends on:
ii  libgcc1  1:5.2.1-17

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.57
ii  glibc-doc  2.19-22
ii  locales2.19-22

-- debconf information:
  glibc/restart-services:
  libraries/restart-without-asking: false
  glibc/restart-failed:
  glibc/disable-screensaver:
  glibc/upgrade: true