Skip to content

Conversation

@nielsdos
Copy link
Member

Introduces intl_convert_utf8_to_utf16_zstr() to convert a UTF-8 string to a UTF-16 string zend_string* instance. This way we avoid a double copy later from a UChar* into a zend_string*.

Introduces intl_convert_utf8_to_utf16_zstr() to convert a UTF-8 string
to a UTF-16 string zend_string* instance. This way we avoid a double
copy later from a UChar* into a zend_string*.
@devnexen
Copy link
Member

is that for perf ? avoid copy vs having to calculate buffer before hand it seems.

@nielsdos
Copy link
Member Author

is that for perf ?

Yes

avoid copy vs having to calculate buffer before hand it seems.

No. The existing code already had to calculate the buffer size beforehand (the call sites passed NULL to the target pointer).

@devnexen
Copy link
Member

ah my bad I missed the first call :) ok nice handy helper you made

@nielsdos nielsdos merged commit b8fa165 into php:master May 25, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants