title: Perl UTF8 CGI and DBI ... what's the correct workflow?
body: <p>I am having the pleasure of rebuilding a perl based web framework to UTF8 support. I took the following steps  </p>
  
  <p>for the main script:<br>
  <code>use open IO =&gt; ":utf8",":std";</code><br>
  <code>use utf8;</code>  </p>
  
  <p>for the DBI Adapter:<br>
  <code>$self-&gt;{dbh}-&gt;{'mysql_enable_utf8'} = 1;'</code>  </p>
  
  <p>and in my request parser for POST and GET, based on CGI:<br>
  <code>foreach (@val) { $_ = decode("UTF-8",$_); }</code>  </p>
  
  <p>This, as far as I can tell, works just fine on my local Ubuntu with Perl 5.10.1, but on the webserver which runs 5.10, decoding POST or GET will mess up the text. </p>
  
  <p>I must admit, I am very confused by the whole UTF8 thing.   I need to<br>
  Read Templates<br>
  Get data from mySQL<br>
  Process POST and GET 
  insert into mySQL<br>
  write Templates  </p>
  
  <p>Is there anything I'm forgetting here? What could cause the inconstant behaviour? Does every module I use in the main script need to specifically <code>use utf8</code> or is it enough if the main script does that?  </p>
  
  <p>Thanks for any hints,<br>
  thomas</p>