3 ms·
Perl has fairly decent utf8 support, off by default: use utf8; allows source to be written in utf8 (string literals, function+variable names etc). Fileha
by jbert 19y ago
Perl has fairly decent utf8 support, off by default:
use utf8;
allows source to be written in utf8 (string literals, function+variable names etc).
Filehandles aren't utf8 by default, but can be put into utf8 mode with the 'binmode' function. (You can go further, and tag filehandles with pretty much any charset encoding and you'll get the Right Thing happening with reads and writes).
Other data sources (db handles etc) generally have some API to control this too.
As a convenience -CIO option to perl puts stdin and stdout into utf8.
Defaulting to off is just the price of back-compatability. Not sure what the plan is for perl6 in this regard.