Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 21, 2025

Fixes #50 by replacing the deprecated uvuni_to_utf8() function with uvchr_to_utf8().

Problem

The uvuni_to_utf8() function has been deprecated since Perl 5.32 and is now being removed from Perl blead, causing build failures for HTML::Parser. The function was used in util.c for converting Unicode code points to UTF-8 byte sequences when decoding HTML entities.

Solution

Replace the single occurrence of uvuni_to_utf8() with uvchr_to_utf8() in util.c. Both functions have identical signatures and behavior:

// Before (deprecated)
tmp = (char*)uvuni_to_utf8((U8*)buf, num);

// After (current)
tmp = (char*)uvchr_to_utf8((U8*)buf, num);

Testing

  • All existing tests continue to pass (464 tests)
  • Manual verification confirms Unicode entity decoding works correctly for:
    • Basic ASCII characters (AA)
    • Extended Latin characters (éé)
    • Unicode BMP characters (☺)
    • Unicode supplementary plane characters (😀😀)

This is a minimal, surgical fix that maintains full backward compatibility while ensuring the module continues to build on modern Perl versions.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Fix "uvuni_to_utf8(): deprecated function being removed from Perl #50" in issue #50 Fix "uvuni_to_utf8(): deprecated function being removed from Perl #50" Aug 21, 2025
@Copilot Copilot AI requested a review from oalders August 21, 2025 02:01
Copilot finished work on behalf of oalders August 21, 2025 02:01
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.

uvuni_to_utf8(): deprecated function being removed from Perl

2 participants