output problems UTF-8??plzzzz help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thamood@gmail.com

    #1

    output problems UTF-8??plzzzz help

    hi guys i have a problem with the output of my script...

    1- i created a simple MySQL Database using phpMyAdmin and the encoding
    was "utf8_general_c i"
    2- i addes a few rows in a table in ARABIC
    3- the names shows well in phpMyAdmin

    the problem is when i want to display them in PHP they all come out in
    "???????" i tried using english names and everything worked well, but
    it wont work with arabic?!!!

    i've already set the page headers to "utf-8" but nothing chnaged!!

    i'm using Textpad to edit my php files?
    i've tried to save the file in UTF-8 but nothing!!

  • Michael Placentra II

    #2
    Re: output problems UTF-8??plzzzz help

    1. Use phpMyAdmin to make sure your MySQL connection encoding is also UTF-8

    2. Make sure all of the following are set to UTF-8 encoding, not just
    one of them (I think column is the only important one anyway though):
    - Database
    - Table
    - Column

    3. Try using the htmlspecialchar s() function on the output if you aren't
    already (you should be already using anyway).

    Comment

    • Willem Bogaerts

      #3
      Re: output problems UTF-8??plzzzz help

      1. Use phpMyAdmin to make sure your MySQL connection encoding is also UTF-8

      When connecting to MySQL 5+, the default client encoding is taken to be
      latin-1, even if you set it to utf-8 in the config file ([mysql]
      section). You will have to issue a "SET NAMES utf8" command after
      connecting, otherwise MySQL will RE-encode from latin-1 to utf-8!

      If you want to see what encoding really is stored in the database (and
      if the data is re-encoded), use the mysqldump utility.

      Best regards,
      --
      Willem Bogaerts

      Application smith
      Kratz B.V.

      Comment

      • thamood@gmail.com

        #4
        Re: output problems UTF-8??plzzzz help

        Thanks guys i'll try them and tell you what happens...

        Best Regards
        Thamood

        Comment

        Working...