Charset Problem

Discussion in 'PHP' started by belgin fish, Jun 22, 2010.

  1. #1
    Hi, currently for some reason characters like

    Ä

    are showing up wrong on my site.

    Does anyone have any idea why? I've set the charset to utf-8

    Thanks!
     
    belgin fish, Jun 22, 2010 IP
  2. Michellu

    Michellu Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use htmlentities() on your text for characters like Ä to be transformed in it's corresponding HTML entity Ä
     
    Michellu, Jun 22, 2010 IP
  3. luckyjazzbo

    luckyjazzbo Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    The solution from Michellu are not really correct. You need to find out where is incorrect charset. Try to check:

    1. Http header
    2. html meta charset
    3. database charset
    4. connection to database must be also done in utf8 encoding (it can be made by querying "set names 'utf8'")

    After that steps everything must be ok.
     
    luckyjazzbo, Jun 22, 2010 IP
  4. belgin fish

    belgin fish Well-Known Member

    Messages:
    1,544
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    2
    #4
    thanks lucky and mechelly, it was when I was retrieving data from the database so great! I believe utf8 encoding the db connection should work ;)
     
    belgin fish, Jun 22, 2010 IP
  5. getlandersgetpaid

    getlandersgetpaid Guest

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also, try this absolutely amazing tool that converts character encoding. I found it not long ago after weeks of pulling my hair out doing a Japanese site coded with SHIFT-JIS. (Substitute the asterisks, I cannot post links yet :p )

    h**p://kanjidict.stc.cx/recode.php
     
    getlandersgetpaid, Jun 23, 2010 IP