mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
Meta+LibUnicode+LibJS: Upgrade to ICU 76.1
This updates our local ICU overlay port to use ICU 76.1. This includes Unicode 16 and CLDR 46. Upstream vcpkg is not able to supply versions past 74 yet due to various dependency issues, but we are able to use this version ourselves. The overlay port now includes a patch to revert ICU's dependence on autoconf 2.72 for now, as this version is not yet available on all systems. All of the test changes were cross-referenced with Firefox to ensure correctness.
This commit is contained in:
parent
0763997591
commit
6a564376fc
Notes:
github-actions[bot]
2025-01-18 22:57:42 +00:00
Author: https://github.com/trflynn89
Commit: 6a564376fc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3295
Reviewed-by: https://github.com/shannonbooth ✅
13 changed files with 95 additions and 52 deletions
|
@ -138,7 +138,13 @@ Optional<TimeZoneOffset> time_zone_offset(StringView time_zone, UnixDateTime tim
|
|||
i32 raw_offset = 0;
|
||||
i32 dst_offset = 0;
|
||||
|
||||
time_zone_data->time_zone().getOffset(static_cast<UDate>(time.milliseconds_since_epoch()), 0, raw_offset, dst_offset, status);
|
||||
// We must clamp the time we provide to ICU such that the result of converting milliseconds to days fits in an i32.
|
||||
// Further, that conversion must still be valid after applying DST offsets to the time we provide.
|
||||
static constexpr auto min_time = (static_cast<UDate>(AK::NumericLimits<i32>::min()) + U_MILLIS_PER_DAY) * U_MILLIS_PER_DAY;
|
||||
static constexpr auto max_time = (static_cast<UDate>(AK::NumericLimits<i32>::max()) - U_MILLIS_PER_DAY) * U_MILLIS_PER_DAY;
|
||||
auto icu_time = clamp(static_cast<UDate>(time.milliseconds_since_epoch()), min_time, max_time);
|
||||
|
||||
time_zone_data->time_zone().getOffset(icu_time, 0, raw_offset, dst_offset, status);
|
||||
if (icu_failure(status))
|
||||
return {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue