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
perlunicode claims about a UTF-8 BOM in perl source are incorrect #13617
Comments
From @tonycozCreated by @tonycozperlunicode claims: =item C<BOM>-marked scripts and UTF-16 scripts autodetected If a Perl script begins marked with the Unicode C<BOM> (UTF-16LE, UTF16-BE, ie. that the following code, hexdumped: 00000000 ef bb bf 70 72 69 6e 74 20 22 54 65 73 74 5c 6e |...print "Test\n| should be treated as unicode, implying to me at least that it should This doesn't occur: tony@mars:.../git/perl2$ ./perl test.pl Is the documentation correct, or unclear, or is the behaviour Perl Info
|
From @rjbsThe documentation is incorrect. We should keep the current behavior of ignoring the BOM and otherwise continuing as normal. The situation is annoying from many angles, but the presence of a BOM changing the behavior of a file that may otherwise be entirely plain ol' ASCII is going to lead to real pain when debugging. I wouldn't want an invisible sequence to start turning on utf8.pm's behavior normally, and even less so as a backward incompatible change. UTF-8 BOMs are best ignored. (Also, best never written out, but that's another matter.) |
The RT System itself - Status changed from 'new' to 'open' |
From @khwilliamsonOn Wed, 26 Feb 2014 15:45:59 -0800, rjbs wrote:
I looked at the code. If the BOM looks like it is for UTF-16, everything in the file is read as UTF-16 and converted to UTF-8, so it is like a 'use utf8'. If the BOM is in UTF-8, it is simply ignored. |
From @khwilliamsonI have now changed the doc to be accurate about this -- |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#121292 (status was 'resolved')
Searchable as RT121292$
The text was updated successfully, but these errors were encountered: