This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bad side-effects of new locale design


>Submitter-Id:	net
>Originator:	Stanislav Brabec
>Organization:
  Stanislav Brabec
>
>Confidential:	no
>Synopsis:	Bad side effects of new locale design
>Severity:	non-critical
>Priority:	low
>Category:	libc
>Class:		change-request
>Release:	libc-2.1.93
>Environment:
    LANG=czech
    LANGUAGE=czech:slovak
Host type: i686-pc-linux-gnu
System: Linux utx 2.2.16 #4 Wed Jul 5 11:18:33 CEST 2000 i686 unknown
Architecture: i686

Addons: linuxthreads crypt
Build CFLAGS: -O69 -fomit-frame-pointer
Build CC: gcc
Compiler version: 2.95.2 19991024 (release)
Kernel headers: 2.2.16
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: no
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
New locale design has some unexpected (and in my opinion bad)
side effects:

1)
LANG=C LANGUAGE=czech returns '?' instead of non-ascii chars
in glibc's strings, if called from unlocalised programs.

Examples (I have strace without locale support):
LANG=C LANGUAGE=czech strace /
execve("/", ["/"], [/* 47 vars */])     = 0
strace: exec: P??stup odm?tnut

LANGUAGE=zh_TW strace /
execve("/", ["/"], [/* 47 vars */])     = 0
strace: exec: ?????????

2)
LANG=C LANGUAGE=czech returns '?' instead of non-ascii chars.

Example:
LANG=C LANGUAGE=czech tar
tar: Mus?te zadat jeden z p?ep?na?? `-Acdtrux'
V?ce informac? z?sk?te p??kazem `tar --help'.

3)

Because (for example Czech) messages are stored in directory
@datadir@/locale/cs/LC_MESSAGES, and new locale is stored in
@libdir@/locale/cs_CZ, if used LANG=cs instead of LANG=czech, message
catalogs are recognized, but locale not
(if LANG is set to czech, all is correct):

unset LANGUAGE
LANG=cs tar
tar: Mus?te zadat jeden z p?ep?na?? `-Acdtrux'
V?ce informac? z?sk?te p??kazem `tar --help'.

Case 1 can be very painfull and needs fix.
Case 2 is relativelly rare, but can simply occur in scripts.
>Fix:
For case 3 it is sufficient to note about it in manual.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]