When I type a Russian word in the input of the below Perl program and click Submit, I see a nonsense instead of Russian letters.
How to pass data from a page encoded as CP1251 to a handler script which needs UTF-8 strings? (The script below is a simple example of this situation.)
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/param/;
if (param('x')) {
print "Content-Type: text/plain; charset=utf-8\n\n";
print "[[".param('x')."]]";
} else {
print "Content-Type: text/html; charset=windows-1251\n\n";
print '<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>';
print "<form><input name='x'/><input type='submit'/></form>";
}