utf8 encoding in Perl and MySql

前端 未结 4 1913
无人共我
无人共我 2021-02-13 16:57

my database (MySql) has a utf8_general collation. I am accessing data from database and showing a webpage (developed in Perl), it is showing Swedish characters (ä,å,ö) with a di

4条回答
  •  臣服心动
    2021-02-13 17:29

    You need to set mysql_enable_utf8 on connection:

     my($dbh) = DBI->connect(
         'dbi:mysql:test',
         'user',
         'password',
         {
             mysql_enable_utf8 => 1,
         }      
    );
    

提交回复
热议问题