Tcl Source Code

View Ticket
Login
Ticket UUID: 565880
Title: [clock format] doesn't support locales
Type: Bug Version: obsolete: 8.4a5
Submitter: rmax Created on: 2002-06-07 15:59:36
Subsystem: 06. Time Measurement Assigned To: kennykb
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-06-26 20:43:12
Resolution: Fixed Closed By: rmax
    Closed on: 2002-06-26 13:43:12
Description:
[clock format] always returns day and month names in
Engish, although it uses strftime() internally which
supports locales, but only if the LC_TIME locale
category has been initialized from the respective
environment variable(s) before.

I first thought of adding a call to
setlocale(LC_TIME,"") or setlocsl(LC_ALL, "") to
unix/tclUnixInit.c, but that would have meant, that a
script can't change the locale it inherited from it's
parent process.
This in turn broke many of the tests in clock.test when
"make test" was called from within a German locale.

Therefore I added the setlocale(LC_TIME,"") call to
tclUnixTime.c just before strftime() is being called,
so that changing env(LC_CTIME) from within a script
changes gets reflected in [clock format] immediately.
User Comments: rmax added on 2002-06-26 20:43:12:
Logged In: YES 
user_id=124643

Applied the patch to 8.4b1.

rmax added on 2002-06-07 22:59:36:

File Added - 24604: clock_locale.patch

Attachments: