Solving little issue in Time Zone acronym
Posted: 02.09.2006, 15:00
Hi,
Several Time Zone include brackets in their name. These brackets are often preceeded by a blank space, so the 'displayAcronym' and 'acronymify' functions make the first blanket appear in the acronym of the Time Zone name, along with the first letter of the next word.
> For example, the acronym displayed for the 'Paris, Madrid (heure d'?©t?©)' local time zone name is PM(d, instead of PM... This acronym is displayed both in the Time dialog and the Time display :
I suggest a quick fix that consists in using the 'strtok' function to remove all the part of the Time Zone name after the open blanket. Here are the changes in the code :
...src/celestia/celestiacore.cpp (~ 3078)
...src/celestia/wintime.cpp (~ 144)
And here's what is eventually displayed:
Note that PM is for Paris, Madrid, not for Post meridiem...
Several Time Zone include brackets in their name. These brackets are often preceeded by a blank space, so the 'displayAcronym' and 'acronymify' functions make the first blanket appear in the acronym of the Time Zone name, along with the first letter of the next word.
> For example, the acronym displayed for the 'Paris, Madrid (heure d'?©t?©)' local time zone name is PM(d, instead of PM... This acronym is displayed both in the Time dialog and the Time display :
I suggest a quick fix that consists in using the 'strtok' function to remove all the part of the Time Zone name after the open blanket. Here are the changes in the code :
...src/celestia/celestiacore.cpp (~ 3078)
Code: Select all
...
*overlay << d << " ";
strtok (tzname[localt->tm_isdst > 0 ? 1 : 0], "("); //Added to solve the blanket issue in Time Zone acronym
displayAcronym(*overlay, tzname[localt->tm_isdst > 0 ? 1 : 0]);
time_displayed = true;
...
...src/celestia/wintime.cpp (~ 144)
Code: Select all
if (strchr(localTimeZoneAbbrev, ' ') != NULL)
strtok (localTimeZoneAbbrev, "("); //Added to solve the blanket issue in Time Zone acronym
acronymify(localTimeZoneAbbrev, strlen(localTimeZoneAbbrev));
And here's what is eventually displayed:
Note that PM is for Paris, Madrid, not for Post meridiem...