Libstdc++: Make timezone parser case-insensitive.
Improves the C++20 chrono timezone database parser to handle case variations in input.
The C++20 <chrono> library’s timezone database parser has been updated to be case-insensitive, fixing a bug where it failed to recognize timezone indicators like ‘Z’, ‘M’, ‘O’, and ‘L’ if they were uppercase. This change ensures that the parser correctly interprets these indicators regardless of their case, making timezone handling more robust.
In Details
The chrono::reload_tzdb function in libstdc++ parses timezone data, including month abbreviations and time indicators. Previously, the parsing logic for indicators like 'Z' (UTC offset), 'M' (month indicator), 'O' (time indicator), and 'L' (day indicator) was case-sensitive. This commit modifies at_time::is_indicator, operator>>(istream&, years_from_to), operator>>(istream&, abbrev_month&), operator>>(istream&, on_month_day&), and chrono::reload_tzdb to accept both lowercase and uppercase versions of these indicators, ensuring consistent parsing.
- Libstdc++
- The GNU Standard C++ Library, the default C++ standard library implementation for GCC.
- C++20 chrono
- The C++20 standard library module that provides facilities for dealing with time, including time zones and time durations.
- timezone database (tzdb)
- A collection of data that describes time zones around the world, including historical changes and daylight saving rules. The C++
<chrono>library uses this data. - parser
- A component of a program that reads input data (in this case, timezone data) and converts it into a structured representation that the program can understand.