[GIT-PULLS] [php-src] PR #23318: Fix GH-23094: Use byte offsets in NumberFormatter parsing

[email protected] (ColumbusLabs)
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/23318
Author: ColumbusLabs

Fixes #23094.

PHP exposes NumberFormatter parsing offsets as UTF-8 byte offsets, while ICU expects UTF-16 code-unit positions. Convert the input offset before parsing and the returned offset afterward for both parse() and parseCurrency().

This targets PHP-8.4 as the lowest actively supported branch; the equivalent C++ change can be merged upward.

Tests:
- debug + ZTS build with ICU 78.3
- sapi/cli/php run-tests.php ext/intl/tests/gh23094.phpt ext/intl/tests/formatter_parse.phpt ext/intl/tests/formatter_parse_currency.phpt
- sapi/cli/php run-tests.php ext/intl/tests (437 passed, 111 skipped, 1 expected failure, 0 failures)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.