Closed s-nez closed 4 years ago
I tested this with Python 3.6.3a and Perl 5.26.1 - all internal tests passing, and works just fine with a bunch of extra Python packages. A strong +1 to include this in an official Inline::Python release!
I actually use a similar heuristic in Inline::Perl5, giving me great confidence that this works well in practice.
Thanks for the PR!
ASCII strings are not flagged as utf8 by default, however since ASCII-only strings are encoded in exactly the same way before and after utf8::upgrade, it's safe to decode them. This allows most regular Perl strings to be properly passed as str to Python 3 (non-ASCII strings will have the utf8 flag on under the utf8 pragma, others will still be passed as bytes).
This fixes #27 .