Welcome to Programmer's Room   

CGI.pm-start_html
start_html


#!/usr/local/bin/perl

use CGI qw/:standard/;

print start_html(-title=>'Secrets of the Pyramids',
    -author=>'fred@capricorn.org',
    -lang=>'ja-JP',
    -encoding => 'Shift_JIS',
    -base => 'true',
    -xbase=>'http://localhost/aaaa/',
    -target=>'_blank',
    -meta=>{'keywords'=>'pharaoh secret mummy',
    'copyright'=>'copyright 1996 King Tut'},
    -style=>[{'src'=>'/styles/style1.css'},{'src'=>'/styles/style2.css'}],
    -script=>[{ -language => 'JavaScript1.0', -src => '/javascript/utilities10.js'}],
    -BGCOLOR=>'blue');

headerで( header(-charset=>'shift_JIS'); )このように指定して
start_htmlで -encoding => 'Shift_JIS' と指定すれば正常に
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />
と書かれます。meta のcharset は-encoding => で書かれたものが採用されます。


【 戻 る 】