Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Converting everything (MySql, perl, CGI, website) to UTF-8

by soonix (Canon)
on Sep 29, 2020 at 12:27 UTC ( [id://11122326]=note: print w/replies, xml ) Need Help??


in reply to Re: Converting everything (MySql, perl, CGI, website) to UTF-8
in thread Converting everything (MySql, perl, CGI, website) to UTF-8

utf8 enables not only Unicode string constants, but also Unicode identifiers (variables, methods, subroutines, …).

If you use Unicode only in String constants (and only occasionally), then it is even possible to stay in ASCII and use charnames' \N{CHARNAME} sequences, so that e.g.
my $default_name = '\N{LATIN CAPITAL LETTER AE WITH MACRON}sop';

would be equivalent to your example. With Perl v5.16 or later, you don't even need to explicitly use charnames for these sequences.

This approach also avoids problems with several (mostly web) frontends of git (or other) repositories that don't handle Unicode well.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122326]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found