WEB latin1 -> utf8

Discussion in 'OT Technology' started by DMClark, Feb 23, 2009.

  1. DMClark

    DMClark Active Member

    Joined:
    Dec 22, 2001
    Messages:
    37,589
    Likes Received:
    0
    So like a lot of people, for many years I had my website and databases setup to use latin1/western. Attempting to transfer everything over to utf8 right now.

    I'm still getting problems with question make icons when viewing in utf8 and fine when viewed at latin1. I've tried switching databases export/import, tried using utf8_encode() and reinserting into the database but that hasn't worked either.

    Only was I have that works is running it through utf8_encode() php function on the actual page, which slows down greatly with large blobs of text.

    So what would be the "correct" way to go about this? I'd like the kill the utf8_encode used in the page.

    With my luck there are tons of different characters from over the years stuck in there from various press releases I am going to need to go back and find and replace as well. :hs:
     
  2. hank85

    hank85 sudo shred /dev/sda -f -v -z --iterations=6

    Joined:
    Jul 23, 2008
    Messages:
    4,360
    Likes Received:
    0
    Run the query

    Code:
    ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
    Remember to backup.
     
  3. DMClark

    DMClark Active Member

    Joined:
    Dec 22, 2001
    Messages:
    37,589
    Likes Received:
    0
    The just changes the database type. it does not alter the encoding of the contents.

    Edit: latest thing i've found to try it turning text into blob, changing the table to utf8, and then changing it back to text. That didn't work either.
     
    Last edited: Feb 23, 2009

Share This Page