Skip to content
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

BBC - undefined symbol: utf8n_to_uvuni #196

Closed
leonerd opened this issue Jun 10, 2022 · 5 comments
Closed

BBC - undefined symbol: utf8n_to_uvuni #196

leonerd opened this issue Jun 10, 2022 · 5 comments
Assignees
Labels

Comments

@leonerd
Copy link
Contributor

leonerd commented Jun 10, 2022

We have a blead-breaks-CPAN report due to a long-deprecated function that has now been removed.

Perl/perl5#19842

t/00_load.t ................ 1/1 Can't load '/src/perl/Cpanel-JSON-XS-4.29/blib/arch/auto/Cpanel/JSON/XS/XS.so'
  for module Cpanel::JSON::XS: /src/perl/Cpanel-JSON-XS-4.29/blib/arch/auto/Cpanel/JSON/XS/XS.so:
  undefined symbol: utf8n_to_uvuni at lib/perl5/5.37.1/x86_64-linux/DynaLoader.pm line 206.
 at t/00_load.t line 3.
Compilation failed in require at t/00_load.t line 3.
BEGIN failed--compilation aborted at t/00_load.t line 3.
t/00_load.t ................ Dubious, test returned 255 (wstat 65280, 0xff00)

The documentation on the now-deleted function suggests an alternative to use:

Instead use L</utf8_to_uvchr_buf>, or rarely, L</utf8n_to_uvchr>.

This function was useful for code that wanted to handle both EBCDIC and
ASCII platforms with Unicode properties, but starting in Perl v5.20, the
distinctions between the platforms have mostly been made invisible to most
code, so this function is quite unlikely to be what you want. If you do need
this precise functionality, use instead
C<L<NATIVE_TO_UNI(utf8_to_uvchr_buf(...))|/utf8_to_uvchr_buf>>
or C<L<NATIVE_TO_UNI(utf8n_to_uvchr(...))|/utf8n_to_uvchr>>.
@rurban
Copy link
Owner

rurban commented Jun 11, 2022

we tried the replacement long time ago, and found that it's new functionality was not sufficient. it is also documented there.
will check again if p5p just kept on with their destruction, or if they fixed it.

@Leont
Copy link

Leont commented Jun 13, 2022

As far as I can tell this is easy to fix, what isn't clear to me is what behavior you would want.

It seems like only difference between utf8n_to_uvchr and utf8n_to_uvuni is that on EBCDIC platforms the latter will assume UTF-EBCDIC instead of ETF-8. I don't know what behavior you would want or not.

@rurban
Copy link
Owner

rurban commented Jun 14, 2022

Look at my code which is there since 5.32: Try to workaround 5.32 utf8n_to_uvuni deprecation.

The correct replacement looks like utf8n_to_uvchr now.

/* Since perl 5.14 we can disallow illegal unicode above U+10FFFF.
   Before we could only warn with warnings 'utf8'.
   We accept only valid unicode, unless we are in the relaxed mode.
    
   perl 5.32 deprecated utf8n_to_uvuni accepting illegal unicode, so relaxed does not
   allow such illegal unicode anymore, rather throws a warning in the 'utf8' category.
   Still looking for a way to get the old correct behavior. */
#if PERL_VERSION > 36
    UV c = utf8n_to_uvchr (s, len, clen,
                          UTF8_CHECK_ONLY | (relaxed ? 0 : UTF8_DISALLOW_SUPER));
#elif PERL_VERSION > 12
    UV c = utf8n_to_uvuni (s, len, clen,
                           UTF8_CHECK_ONLY | (relaxed ? 0 : UTF8_DISALLOW_SUPER));
#elif PERL_VERSION >= 8
    UV c = utf8n_to_uvuni (s, len, clen, UTF8_CHECK_ONLY);
#endif

Encode is in a worse situation than me, he wrote everything by himself to be independent on this mess.

@rurban rurban self-assigned this Jun 14, 2022
@rurban rurban added the bug label Jun 14, 2022
rurban added a commit that referenced this issue Jun 14, 2022
This seems to work, but is against the p5p recommendations.
Fixes GH #196
rurban added a commit that referenced this issue Jun 14, 2022
This seems to work, but is against the p5p recommendations.
Fixes GH #196
@rurban
Copy link
Owner

rurban commented Jun 14, 2022

BTW: JSON::XS needs the same workaround now. He has no bugtracker.

@rurban
Copy link
Owner

rurban commented Jun 27, 2022

Fixed with 4.30

@rurban rurban closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants