I need help encoding a script to UTF8

Discussion in 'PHP' started by Recure, May 11, 2010.

  1. #1
    Hi,

    I bought the script Gen4 weeks ago, and after installing it I noticed that it does not support any added Arabic characters, they turn into symbols.

    The problem was in my database too, but after changing the encoding of the database and all its tables from latin1 to utf8_general_ci, it got fixed, only on the database.

    But the problem was still going in the script, when I type any Arabic word in the script from admin-panel it changes to symbols, and when I add Arabic words from the database it shows as question marks on the main page.

    If you check my site right now (rb7net.net) you'll notice that the name of the site is showing as "RB7 ????". I tried many ways but none of them worked, like:

    1) changing the encoding of the database like I mentioned above

    2) tried adding the following code to the file header.php in the theme folder
    <meta http-equiv="Content-Type" content="text/html; charset=urf-8">
    PHP:
    3) used the program Rapid PHP Editor and changed the encoding of every single php file in the script to "UTF-8 without ROM"

    ---

    I believe that the thing I'm missing is a code I should add to the config.php or db.php files. something like:
    set character_set_server='utf8'; set names 'utf8';  
    PHP:
    or
    <?php     mysql_connect($db_hostname, $db_username, $db_password);     mysql_query("set names 'utf8';");  ?> 
    PHP:
    Thanks for taking the time to read such a long post and sorry for making it too long.

    Thanks!
    Recure.
     
    Recure, May 11, 2010 IP
  2. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    My guess would be that something in the code is presetting it to the different format, I would glance through the files that it might be in and when/if you find it delete it. Otherwise I would really have no other guess.
     
    Pudge1, May 11, 2010 IP
  3. Recure

    Recure Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your reply. That might be the issue, but I can't figure out with code is making this problem, or maybe if I could just add another code to the connection files between database and script, to make the connection based on utf8.
    here's the script, the connection files are under "lib" folder. rb7net.net/Upload.zip
     
    Recure, May 11, 2010 IP