Right, but that's static HTML. Try this and look at what your browser thinks the encoding is:
#!/usr/local/bin/perl
use strict;
use warnings;
use CGI qw(:standard);
print header();
print <<HTML;
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<script>
document.write(location.search + "<br>");
</script>
<form>
<input type="hidden" name="test" value="ä">
<input type="submit">
</form>
HTML
print end_html();
Unless you tell it not to, CGI.pm will set the encoding to iso-8859-1 in the HTTP header. In this case the meta tag has no effect, at least in recent versions of IE and Mozilla. |