Future of Win32::FindFile

Started by obetz, March 23, 2020, 02:08:21 PM

Previous topic - Next topic

obetz

Hi Phil,

in addition to the long known error in the automated selftest already described in https://exiftool.org/forum/index.php?topic=10135.msg52996#msg52996 the compilation of Win32::FindFile throws also warnings about the deprecated utf8_to_uvchr() function.

According to https://perldoc.perl.org/perl5160delta.html utf8_to_uvchr() "is deprecated because it could read beyond the end of the input string" when the input is malformed UTF-8.

BTW: perl5160delta was issued 2013-03, one year before Win32-FindFile-0.15. The FindFile changelog states "no compile warnings"...

https://perldoc.perl.org/perlapi.html#utf8_to_uvchr writes: "It is planned to remove this function from a future release of Perl. Do not use it for new code; remove it from existing code"

So it might be a good idea to improve Win32::FindFile or find an alternative before a new Perl version doesn't support this function.

I tried to understand the code to see whether I can fix it but I gave up after an hour.

I don't see what large parts of the code are good for, and I don't know the XS specifics. After all, it's not the most robust code I've seen yet (I can provide examples on request).