build: stop zoneinfo builder scripts changing '_' -> ' '
authorPaul Donald <[email protected]>
Mon, 20 Oct 2025 12:36:52 +0000 (14:36 +0200)
committerPaul Donald <[email protected]>
Mon, 20 Oct 2025 12:38:28 +0000 (14:38 +0200)
Zone names are correct when they contain an underscore, especially when
the zone names are used as input to functions and libraries.

See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

e.g.

Africa/Addis_Ababa
Africa/Dar_es_Salaam
Pacific/Port_Moresby

This can be revised in future if some GUI aesthetic is required.

Signed-off-by: Paul Donald <[email protected]>
build/zoneinfo2lua.pl
build/zoneinfo2ucode.pl

index e4e637292df7b4a12f0425d0b9e6c0b4ea0b53ef..c996634444a65eb57299647f2b25a34c230f5bbe 100755 (executable)
@@ -39,7 +39,8 @@ while( ! eof ZTAB ) {
                close ZONE;
 
                if( $tz ) {
-                       $zone =~ s/_/ /g;
+                       # Don't replace underscores with spaces: correct names contain underscores.
+                       # $zone =~ s/_/ /g;
                        $TZ{$zone} = $tz;
                }
        }
index 941255f2f47dcee3b70a8b0d93df288faee8f00a..c902087008a6354ef7c57baf4f77b2943d8c8332 100755 (executable)
@@ -33,7 +33,8 @@ while( ! eof ZTAB ) {
                close ZONE;
 
                if( $tz ) {
-                       $zone =~ s/_/ /g;
+                       # Don't replace underscores with spaces: correct names contain underscores.
+                       # $zone =~ s/_/ /g;
                        $TZ{$zone} = $tz;
                }
        }