in reply to Converting everything (MySql, perl, CGI, website) to UTF-8

  • You can use <li> to make bullets, they look much nicer than asterisks (see this post for an example).

  • use UTF;

    You probably mean

    use utf8;

  • Note that in MySQL, you can configure the encoding used for: plus various defaults in case any of the specific ones wasn't specified.

  • Note that :utf8 and :encoding(UTF-8) layers aren't identical. The latter is more strict and does more checks.

  • this can fail if the $filename variable is not also in UTF8

    The encoding of the contents is in no way related to the encoding of the filename. Moreover, at least in a web app, the filename on your system should be controlled by you, not a user input, so you should always know what encoding the filename uses.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
  • Replies are listed 'Best First'.
    Re^2: Converting everything (MySql, perl, CGI, website) to UTF-8
    by jfrm (Monk) on Mar 17, 2018 at 07:24 UTC

      Thanks for correction and formatting advice; I wrote the post in a hurry but have tidied it a bit today.

      This is a list of problems that arose in the real world that, regrettably, I find myself inhabiting; Information comes into my programs from all manner of different places and in some, I can assure you that the open command crashed until I used I first converted the filename viz: my $utf8filename = encode('utf8', $payfile);. Perhaps there was a better way, but sometimes you just need to kill the obscure error expediently.