develooper Front page | perl.perl5.porters | Postings from January 2022

Pre-RFC: Improve “wide character” warnings

Thread Next
From:
Felipe Gasper
Date:
January 25, 2022 21:04
Subject:
Pre-RFC: Improve “wide character” warnings
Message ID:
925BF219-6990-434C-A36B-29A212D14CCF@felipegasper.com
PART 1:

-----
> perl -e'print "\x{100}"'
Wide character in print at -e line 1.
Ā
-----

^^ Would it benefit if that warning instead were something like:

-----
Wide character in print (you forgot to encode) at -e line 1.
-----

The status quo merely describes the problem; I’d like to add a bit that points to the fix.

--------------------------------------------

PART 2:

While I’m raising the issue, what would it take for Perl-issued warnings (and exceptions?) writ-large to include some sort of searchable, indexed lookup code, something like:

-----
W.18: Wide character in print (you forgot to encode) at -e line 1.
-----

Then users could search on that code in Perl’s documentation, maybe like:

-----
perldoc W.18
-----

Thoughts?

-FG

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About