Skip to content

sv_vcatpvfn_flags: Use utf8_to_uv #23083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2025
Merged

Conversation

khwilliamson
Copy link
Contributor

This is a change in behavior for malformed input. Previously it warned and substituted 0; the warnings remain, but now it substitutes the REPLACEMENT CHARACTER.

  • This set of changes does not require a perldelta entry.

@tonycoz
Copy link
Contributor

tonycoz commented Mar 10, 2025

This is a change in behavior for malformed input. Previously it warned and substituted 0; the warnings remain, but now it substitutes the REPLACEMENT CHARACTER.

I'm confused, you're calling utf8_to_uv_or_die(), which croaks on a decoding failure, but the commit message says it produces a replacement character instead.

@khwilliamson
Copy link
Contributor Author

It looks like I was the one who was confused. I hope it was just a copy paste error. Anyway, it doesn't return, but croaks in the face of malformed input. I'm now a bit reticent about doing this given that a couple of such commits had to be backed out. But I don't know that there is a decent recovery path forward here when this condition occurs. And there are already places in this function where it panics when it doesn't know how to go on

@tonycoz
Copy link
Contributor

tonycoz commented Mar 10, 2025

  • This set of changes does not require a perldelta entry.

If this and other similar changes remain I do think we do need some sort of perldelta entry.

@khwilliamson
Copy link
Contributor Author

I agree.

@khwilliamson khwilliamson added the defer-next-dev This PR should not be merged yet, but await the next development cycle label Apr 24, 2025
@jkeenan jkeenan removed the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jul 3, 2025
@jkeenan
Copy link
Contributor

jkeenan commented Jul 3, 2025

  • This set of changes does not require a perldelta entry.

If this and other similar changes remain I do think we do need some sort of perldelta entry.

5.43.0 has been released; development on this p.r. may resume.

@jkeenan
Copy link
Contributor

jkeenan commented Jul 17, 2025

@khwilliamson, it appears from your earlier comments that you're somewhat dubious about proceeding with this p.r. If that is so, would we better off closing this p.r. and opening a new one at an appropriate time? Thanks.

This is a change in behavior for malformed input.  Previously it warned
and substituted 0; now it warns and substitutes the REPLACEMENT
CHARACTER, which is the better choice.
@khwilliamson
Copy link
Contributor Author

I changed it to not croak, but to insert the REPLACEMENT CHARACTER instead of a NUL. The new way is the Unicode-sanctioned behavior..

I didn't add a test, because this shouldn't happen except if someone fiddles with the internals.

@jkeenan
Copy link
Contributor

jkeenan commented Jul 17, 2025

I changed it to not croak, but to insert the REPLACEMENT CHARACTER instead of a NUL. The new way is the Unicode-sanctioned behavior..

I didn't add a test, because this shouldn't happen except if someone fiddles with the internals.

If you can add a link to that governance in Unicode, I think that would be good for future reference.

@khwilliamson khwilliamson changed the title sv_vcatpvfn_flags: Use utf8_to_uv_or_die sv_vcatpvfn_flags: Use utf8_to_uv Jul 17, 2025
@khwilliamson
Copy link
Contributor Author

khwilliamson commented Aug 9, 2025

I created #23553 to discuss the REPLACEMENT CHARACTER, which addresses @jkeenan 's concerns

@khwilliamson khwilliamson merged commit 89b92b6 into Perl:blead Aug 9, 2025
33 checks passed
@khwilliamson khwilliamson deleted the vcat_or_die branch August 9, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants