Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 07-06-2005, 05:08 PM html encoding
Novice Talker

Posts: 9
Trades: 0
Hello All,

I'm a newer here. Just found this forum by googling. I'm not sure if this is the right place for my question or I should post it at PHP forum. Please forgive me if i'm wrong.

Here is my question:

I just get simple mboard php script that takes the meesage with Chinese characters (encoding gb2312) and writes it to a html file.

First, I tried: using gb2312 encoding in the html header file and the html page created by php script like this:

Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My Title in Chinese</title>
<meta content="text/html; charset=gb2312">
...
</head>
<body>
...
...(mixed Chinses and English characters)
...
</body>
</html>
The page is successfully created. However, when I looked at the page with IE, the IE automatically set the encoding to Western European (ISO) instead of using gb2312 even it is set in the head of the html file. So the Chinese characters are not correctly displayed. To see the page correctly I have to, every time, choose "gb2312" encoding from IE when i browe the page.

I also tried using uft-8 encoding, but same problem. Chinese charecters can be displayed when I manually set the proper encoding in IE. The problem is that IT could not detect and use the encoding in the html head and alway using Western European (ISO).

I don't know it the problem comes from the type of file php created or from the http server or anything wrong with the html file above.

I'm a newbie in html and php and totally lost. I wonder if antone can point me a direction. Thanks.
moon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-07-2005, 08:32 AM
danburzo's Avatar
Skilled Talker

Posts: 82
Location: Bistrita RO
Trades: 0
your meta tag is missing a part. It should be something like this:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
danburzo is offline
Reply With Quote
View Public Profile
 
Old 07-07-2005, 05:17 PM
Novice Talker

Posts: 9
Trades: 0
Thank you, danburzo. That was a mistake in the php script. But the problem has not been solved by adding the miss part. Thanks anyway.
moon is offline
Reply With Quote
View Public Profile
 
Old 07-08-2005, 03:01 AM
danburzo's Avatar
Skilled Talker

Posts: 82
Location: Bistrita RO
Trades: 0
i remember having the same problem with the encoding once, but the problem was from the server. You need to configure the httpd.conf file (don't really know how)... you should contact your host. It's something about AddDefaultCharset set to western european.
danburzo is offline
Reply With Quote
View Public Profile
 
Old 07-14-2005, 09:51 AM
Novice Talker

Posts: 9
Trades: 0
YES!!!! The problem was solved! Thank you, danburzo! You are right. The problem is from the httpd server side. Just for anybody else have the same problem. I added a parameter -T GB2312 (or any other encoding) to the thttpd's command line when it starts. You can also add charset=GB2312 to the httpd.conf file. It will overwrite the default encoding (ISO-8859-1). Thank you again, danburzo.
moon is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to html encoding
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21214 seconds with 12 queries