-
Notifications
You must be signed in to change notification settings - Fork 577
[doc] PerlIO::encoding, error in documentation, FB_PERLQQ et.al. #18907
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
Comments
Is there someone familiar with PerlIO::Encoding who could review this critique of the documentation? |
@Leont is probably the only person familiar with this module and associated flags |
You're correct, this is wrong.
IMHO it shouldn't mention either. As far as Perl code is concerned, internal encoding shouldn't matter. |
Could someone propose a documentation patch that would address the issues raised in this ticket? |
@pali, do you have an idea about this? |
@khwilliamson Yes, documentation needs improvements. |
@pali, I was hoping since you are more familiar with the operation of this than I am, that you could propose some wording; which I could polish if necessary, me being a native English speaker |
I have since fixed the code so that it automatically filters out the |
The documentation of PerlIO::encoding in https://perldoc.perl.org/perl,
v5.34.0 contains an error in the Synopsis section.
The value FB_PERLQQ is not allowed for fallback, as it contains the
'LEAVE_SRC' bit. In addition the 'STOP_AT_PARTIAL' bit is missing,
which is mandatory for use in $PerlIO::encoding::fallback.
Unfortunately this is not contained in any FB_xxx CHECK value, thus
the bits have to be given explicitly.
Thus a valid combination of mask bits should be used, e.g.
'STOP_AT_PARTIAL | PERLQQ'. This also requires to either export
':fallback_all' in "use Encode", or to write the mask bits with
'Encode::...'.
If I understand github #18496 correctly, then the changes there
will enforce a correction of this error internally. But that would
be for v5.34 only, and still the documentation should give correct
values and should be applicable to older versions also.
BTW, if the documentation is changed anyhow, "UTF-8" in the text
further down should be changed to "UTF8", as Perl's internal strings
are loose, not strict. This would make the documentation at bit more
consistent.
As an additional thought: It could be useful to export (or at least
allow the export) of 'ONLY_PRAGMA_WARNINGS' from Encode. This bit is
anyhow included in the default setting of $PerlIO::encoding::fallback,
but it is not available for setting of the variable by the user.
The text was updated successfully, but these errors were encountered: