SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist kooshin.com's Avatar
    Join Date
    Dec 2003
    Location
    http://kooshin.com
    Posts
    505
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql and arabic

    hello guys i need your help.

    How can mysql display Arabic well. Right now it is displaying them as ??????? . I'm using mambo and everyting is working fine on the local server but when online all i see is question marks .

    here is the server info

    Server version: 4.1.21-standard
    Protocol version: 10
    Server: Localhost via UNIX socket
    User: islamic@localhost
    MySQL charset: UTF-8 Unicode (utf8)


    the local server of the mysql is MySQL 4.0.24-nt .


    how can i fix this problem?

    Thanks in advance.

  2. #2
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    260
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be a 'AddDefaultCharset' apache problem. You may need to turn that setting off.

    If I were a bettin' man, I'd say the problem is with mysql. Although your DB variables may all be correctly set to utf8 (connections and all), you may still get the question marks.

    Try this...
    Before all your DB queries, send this query first:
    PHP Code:
    mysql_query("SET NAMES 'utf8'"
    If that solves it, you either need to do the above before executing any of your real queries.

    If you have access to your mysql config file (my.cnf) then you can avoid the hassle above by adding the following to the [mysqld] section:
    Code:
    [mysqld]
    init_connect="SET NAMES utf8"
    Also, make sure the following variables are properly set:
    Code:
    [client]
    default-character-set=utf8
    
    [mysqld]
    default-character-set=utf8
    Keep in mind that the my.cnf fix does not work it your script is connecting to mysql using the 'root' account.

  3. #3
    SitePoint Evangelist kooshin.com's Avatar
    Join Date
    Dec 2003
    Location
    http://kooshin.com
    Posts
    505
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi there, thanks for the answer and the detailed info. I will do that and let you know the result. Thanks again.


Bookmarks

Posting Permissions

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