Display chinese characters (GB2312)

Discussion in 'HTML & Website Design' started by Hot-screensaver, Apr 12, 2007.

  1. #1
    I have created a webpage and the content is in Chinese Simplified (GB2312) encoding. On my localhost, it displays perfectly in Firefox and IE.

    However, on the live webserver, it refuses to display correctly when I view it with either Firefox or IE. I will have to manually select the Character Encoding as Chinese Simplified (GB2312) then only will the chinese characters come out.

    Of course this line is in the page <meta http-equiv="Content-Type" content="text/html; charset=GB2312">

    How come? Is there a way to force it to always use GB2312 encoding?
     
    Hot-screensaver, Apr 12, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    May we have a link? The server response header will tell us a lot, as it is more authoritative than the meta char-set.

    As a general rule, you should use utf-8 to save the file, and the server should specify utf-8. If the server specifies iso-8859-x as the default charset (not unusual), your characters are being interpreted as single octets.

    cheers,

    gary
     
    kk5st, Apr 12, 2007 IP
  3. Hot-screensaver

    Hot-screensaver Peon

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    That's my client's website, and the client do not like me revealing the site here... :(

    How can I check the header, and how can we force it to use utf-8? The page is done in PHP.

    Thanks.
     
    Hot-screensaver, Apr 12, 2007 IP
  4. Hot-screensaver

    Hot-screensaver Peon

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have found the solution! It's so simple.
    Just instruct the server to use GB2312. Use php:

    header('Content-Type: text/html; charset=GB2312')
     
    Hot-screensaver, Apr 12, 2007 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    There ya go. :)

    cheers,

    gary
     
    kk5st, Apr 12, 2007 IP