How to test/classify CPAN modules for utf8 correctness

前端 未结 1 543
滥情空心
滥情空心 2021-02-02 15:50

Here is an excellent question and the wonderful tchrist\'s answer with 7+24+52 advices&comments how to make an perl program utf8 safe.

But here is 19k CPAN modules.

相关标签:
1条回答
  • 2021-02-02 16:22

    Chill, the situation is less dire than you're thinking. No one except tchrist operates on this level of Unicode correctness, also see Aristotle's recent commentary. As with all things, you get 80% of the way with 20% of the effort. This base effort, namely getting the topic of character encoding right, is well documented; and jrockway repeats it in his answer in that thread.

    Replies to your specific questions:

    1. No, there isn't. There is no concerted effort to collect this information in a central place. The Perl 5 wiki could be used to document problematic modules, Juerd already discusses some in uniadvice. I would really like to see a statement from each module author in their documentation that "this module DTRT w.r.t. encoding", but I don't see it happening. Authors won't even reveal whether their module is taint-safe, and this feature exists for decades!

    2. encoding::warnings can be used to smoke out unintended upgrades. I mention it in the work-flow of Checklist for going the Unicode way with Perl

    3. You can't do that with Perl::Critic or static analysis. I see no other way than knowledgable people poking at the module with pointy characters until it falls apart (or not), like mirod just commented.

    0 讨论(0)
提交回复
热议问题