[tz] ID string in zic's output files
Steven R. Loomis
srl at icu-project.org
Wed Feb 22 23:03:27 UTC 2017
Thanks for checking on this.
Well… one could store a 15 byte *hash of the ID string*.
$ echo -n 'America/Indiana/Vevay' | shasum -a 1 | cut -c1-30
$ echo -n 'America/Los_Angeles' | shasum -a 1 | cut -c1-30
$ cd /usr/share/zoneinfo/ ; ( for z in $(find . -type f | cut -d/ -f2-);
do echo $(echo -n $z | shasum -a 1 | cut -c1-30) $z; done) | fgrep
On 2/22/17 2:41 PM, Arthur David Olson wrote:
> So much for the idea of storing ID strings in zic output files as
> (unused) abbreviations. The zone America/Pangnirtung needs 41 bytes to
> store all the abbreviations it uses:
> -00 AWT APT AST ADDT ADT EDT EST CST CDT
> A zic output file can have at most 50 bytes of abbreviations, as set
> by TZ_MAX_CHARS in tzfile.h The 9 bytes remaining isn't enough for our
> (We don't want to boost TZ_MAX_CHARS; localtime.c checks files to
> ensure they have at most that many abbreviation characters; files with
> more would be rejected, at least by now-in-the-field binaries compiled
> from localtime.c)
> Note that the last component of "Zone" names (such as the "Vevay" in
> "America/Indiana/Vevay") would fit in the 15 "reserved for future
> use" bytes at the front of zic output files; full names would not
> (always) fit, and there would not (always) be room for a prefix such
> as "@(#)."
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 455 bytes
Desc: OpenPGP digital signature
More information about the tz