Hi,
I am developing a Web application using Perl and a database. The Perl script
is responsible for getting data from the database and then generate a HTML
page. The data to be retrieved is encoded in UTF8. Here's part of my script:
...
print( start_html( { -head=>meta({-http_equiv=>'Content-Type',
-content=>'text/html; charset=utf-8'}), ...
...
# Get data from DB
print( "<select name = \"Games\">\n" );
while ( @row = $statementHandle->fetchrow_array() ) {
print( "<option>" );
print( "$row[ 2 ]. $row[ 1 ], $row[ 0 ]" );
$test="$row[ 2 ]. $row[ 1 ], $row[ 0 ]";
print( "</option>" );
}
print( "</select>\n" );
print( h2($test) );
...
$test contains some Russian characters encoded in UTF8. On display, it
showed up as thick bars in the list box. However, print( h2($test) ) shows
the correct Russian characters. I am wondering if it is a font problem. But
if it is, why should the latter be displayed correctly?
Would appreciate your comments and help.
Will