Perl is not yet fully unicode compatible, despite the fact we will soon ring in the year 2024. Perl's official documents still see
security risks with unicode, saying, for example: "Also, the use of Unicode may present security issues that aren't obvious, see '
Security Implications of Unicode' below." There are, however, some ways to get around this. One of those is to include pleas in your own code to use unicode, such as these:
use utf8; #FOR THE "wide characters" IN YOUR OWN CODE
binmode STDIN, ":utf8"; #FOR INCOMING UTF8
binmode STDOUT, ":utf8"; #FOR OUTGOING UTF8
binmode STDERR, ":utf8"; #AND FOR ERRORS SEPARATELY
use open qw/:std :utf8/; #THIS ONE CAN BE PROBLEMATIC WITH DATA
+BASE INTERACTIONS
use open ':encoding(utf8)'; #ANOTHER WAY OF SAYING IT
use feature 'unicode_strings'; #ANOTHER PART OF 'TMTOWTDI' FOR PERL U
+NICODE
When it's someone else's code, however, the situation becomes more problematic. Be careful which modules you choose to incorporate.
Of course, if these options fail, and the UTF8 characters are not quintessential to your application, you can also remove them all and stick with a pure-ASCII solution. This may cause the least headache if UTF8 is not important to you. You could then use virtually any modules, and have no issue with any I/O operations. But it will not be very future-proof.
I look forward to the day when Perl has advanced to using unicode natively--by default. It's too bad that day is not already here.
See more here: https://perldoc.perl.org/perlunicode
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.