Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Converting everything (MySql, perl, CGI, website) to UTF-8

by choroba (Archbishop)
on Mar 16, 2018 at 08:33 UTC ( #1211015=note: print w/replies, xml ) Need Help??


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:
    • storing the data
    • sending the data
    • getting the data
    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.

    Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://1211015]
    help
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (5)
    As of 2020-11-27 17:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?