Page MenuHomeFreeBSD

Install and use /usr/share/zoneinfo/zone1970.tab
ClosedPublic

Authored by tmunro on Jun 15 2019, 1:16 AM.

Details

Summary

Currently we install just zone.tab, but it says:

# This file is intended as a backward-compatibility aid for older programs.
# New programs should use zone1970.tab.  This file is like zone1970.tab (see
# zone1970.tab's comments), but with the following additional restrictions:
#
# 1.  This file contains only ASCII characters.
# 2.  The first data column contains exactly one country code.
#
# Because of (2), each row stands for an area that is the intersection
# of a region identified by a country code and of a timezone where civil
# clocks have agreed since 1970; this is a narrower definition than
# that of zone1970.tab.

Considering messages like [1] I suppose we should install zone1970.tab too for other software that wants to use it, and then we might as well use it for tzsetup(8) too.

[1] http://mm.icann.org/pipermail/tz/2014-October/021760.html

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tmunro created this revision.Jun 15 2019, 1:16 AM
koobs added a subscriber: koobs.Jun 17 2019, 6:30 AM
tmunro updated this revision to Diff 59191.Jun 29 2019, 10:39 AM
tmunro retitled this revision from Install /usr/share/zoneinfo/zone1970.tab to Install and use /usr/share/zoneinfo/zone1970.tab.
tmunro edited the summary of this revision. (Show Details)

I suppose we could update tzsetup(8) to use the new version too, if we're going to install it. So here's a patch that teaches that to handle the modern format with multi-country first field, and gets rid of the hardcoded "Arctic" menu because it went away in the data (concretely that means that people in https://en.wikipedia.org/wiki/Svalbard would need to choose Europe -> Norway, whose timezone they share as I assume they are well aware, being "a full part of the Kingdom of Norway").

However, I wonder if the encoding situation is OK; the modern version is in UTF8, and for example, if you pick Asia -> Kazhakstan, you'll see some non-ASCII characters. I'm not sure I understand ncursesw's model of character encoding, but I can see that we are already showing UTF8 text directly from /usr/shared/misc/iso3166 ("Côte d'Ivoire", "Curaçao", ...), so maybe that's OK.

However, I wonder if the encoding situation is OK; the modern version is in UTF8, and for example, if you pick Asia -> Kazhakstan, you'll see some non-ASCII characters. I'm not sure I understand ncursesw's model of character encoding, but I can see that we are already showing UTF8 text directly from /usr/shared/misc/iso3166 ("Côte d'Ivoire", "Curaçao", ...), so maybe that's OK.

ncursesw just follows the LC_CTYPE to determine the character encoding (it actually uses the multibyte(3) functions), so it deals fine with UTF8 as long as a UTF8 locale is set (assuming the terminal can also cope).

tmunro added a subscriber: philip.Jul 15 2019, 10:28 AM
philip accepted this revision.Jul 15 2019, 3:57 PM

I think this is an excellent idea and the changes to tzsetup(8) look sensible. Please, go ahead and commit this.

This revision is now accepted and ready to land.Jul 15 2019, 3:57 PM
allanjude accepted this revision.Jul 16 2019, 3:03 PM
allanjude added a subscriber: allanjude.

Approved By: allanjude (mentor)

This revision was automatically updated to reflect the committed changes.