Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008

    Question Unanswered: Charset conversion ( latin1 to utf-8) - help needed please

    I'm building a new php script with a mysql db that has utf-8 charset and utf8_general_ci collation, and utf-8 charset in all pages site wide, everything went ok till I tied connecting to my vbulletin database just to get some info to display on the main site's page like last 10 threads, members .. etc...
    I got some strange characters when displaying it on a utf-8 html page. thats because my vbulletin db has latin1 charset and latin1_swedish_ci collation and windows-1256 (arabic) encoding on the forums pages(pretty messed up, huh?). so I tried sending this query:
    set character_set_server='latin1'
    set names 'latin1'
    This time I got (����) like characters, BUT, when choosing windows-1256 encoding in the browser, I was able to properly view the data, of course with the rest of my utf page showing other freaky characters!
    Tried viewing the db's data in phpMyadmin using utf8 as browser encoding, and again with the weird chars...
    So from what I understood, it seems that since my forums pages are in windows-1256 encoding, the latin1 vbulletin db is storing windows-1256 chars that can not be viewed in any encoding other than windows-1256, which is a pretty MESSED UP thing!.
    Now I tried googling about converting my db's charset to utf-8 and get it over with, and for 2 hours and found nothing specific and useful for doing it the right way. so I thought I should come here and learn from the best

    I want to convert the db, tables, columns and the actual data stored in the db to have a charset and collation of utf-8, so I can rest in piece and have all my future scripts working side by side with my forums.
    I just need to understand what should I be looking for/doing. a link, a guide, a bunch of queries that I can put in a loop using php, a tool or anything that could help would be just great!

    Thanks in advance

  2. #2
    Join Date
    May 2008
    Anybody??? Please??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts