Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Data are shown up as " ???? ??? ???? ??"

    Hello all

    I have a big problem that has been preventing me from publishing my website for about a week ...

    I have an arabic php website ... now arabic shown up when it's html ... while the data retrieved from the database are shown up as: "??? ????? ?? ?????" (question marks) ... I use two ways for displaying arabic:
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
    and a PHP code:
    Code:
    <?php 
    header('Content-Type: text/html; charset=cp1256'); // cp1256 = windows-1256 
    header('Content-Language: ar'); 
    ?>
    and this
    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar">
    now with all of these codes, arabic data retrieved from the database still show up as question marks ??? ????? ??

    I doubt that something is worng in the phpmyadmin.

    In phpmyadmin, in other servers and on localhost, both Arabic (ar-win-1256) and Arabic (ar-utf-8) used to appear ... but after I uploaded phpmyadmin to "current server", it only showed the latter one which is: Arabic (ar-utf-8) ... so I had to choose it cuz it's the only choice, while I used to choose Arabic(ar-win-1256).

    I chose "cp1256_general_ci" as a collation for the database and the table and the mysql connection collation.

    now data in the database are shown in correct arabic format ... but when openning the webpage, it's ??? ?????? ?????

    so ... what else can I do? I tried and tried and tried and nothing changed ...

    Please help ...

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    211
    Thanks
    0
    Thanked 1 Time in 1 Post
    Remove the META element and change "header('Content-Type: text/html; charset=cp1256');" to this:

    Code:
    header('Content-Type: text/html; charset=utf-8');

  • #3
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok ... I forgot to tell you that I used each code alone, I mean, when I used the php code I removed the meta tag ...

    about the utf-8 I tried it before and didn't work, and the worse it changed the html arabic data into some strange symbols.

    any way ... I think I know where is the problem... it's in the database. I guess I have to drop the tables and then recreate them with an sql statment including the charset. but I am not sure cuz I've got two choises: cp1256_general_ci and cp1256_bin and I don't know what's the difference ...
    and do I have to set the collations in the sql statment while inserting data?

    please answer me ... Help me.


  •  

    Posting Permissions

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