Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Proper Unicode handling in Perl

by Aldebaran (Curate)
on Sep 10, 2019 at 06:30 UTC ( [id://11105928]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Proper Unicode handling in Perl
in thread Is there some universal Unicode+UTF8 switch?

Codepages seem to be the sticky wicket:

C:\Users\tblaz\Documents\evelyn>perl 1.hello.cyr.pl
default encoding:
Active code page: 437
Привет
------------
Active code page: 65001
Привет


#!/usr/bin/perl -w use 5.016; use utf8::all; #binmode STDOUT, ":utf8"; say "default encoding:"; system "chcp"; say "Привет"; say "------------"; system "chcp 65001"; say "Привет"; __END__

Once the right codepage is present, the test succeeeds:

C:\Users\tblaz\Documents\evelyn>perl 1.cyr.pl
...
-------
Content-Type: text/html; charset=utf-8

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Мой тест</title>
</head>
<body>
Бабкинъ Михаилъ
</body>
</html>
C:\Users\tblaz\Documents\evelyn>

Now I wonder how to make that the default setting....

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 22:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found