Điện thoại: 0944210999

DISPLAYING CHINESE CHARACTERS IN HTML

DISPLAYING CHINESE CHARACTERS IN HTML

Getting extended character sets to display correctly in HTML is a bit of a minefield. There are lots of things which can trip you up on this journey.
To make things even more complicated, there are numerous different sub-sets of Chinese characters which you'll need to be able to display. for example:
  • simplified Chinese: 
  • traditional Chinese: 
  • Pinyin: Hànyǔ;
  • simplified Chinese: 
  • traditional Chinese: 
  • Chinese: 
This article will help you get over some of the most simple obstacles

CHARSET

Life will be a lot easier if we make sure we're using the correct Charset: UTF-8. You'll need to make sure that you have the right <meta> content-type header in your HTML to start with:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
This will need to go in the <head> section of your web page.

SERVER HEADERS

Make sure that your webserver is sending the correct HTTP content-type header as well. The Firefox developer toolbar can check your server response headers: it is under the "Information" menu.
The server should be sending a response header like this:
Content-Type: text/html; charset=UTF-8
If the "charset=UTF-8" bit is missing from the Content-Type response header, or if it says something other than "UTF-8", then this will cause you problems. Ideally, you need to fix this in your server config, but you could also use a PHP header() directive at the top of a scripted document to make sure that your server sends the correct header.

FILE / FTP ENCODING

This one has caught everybody out at one time or another.
You must make sure that your save your document in UTF-8 format and upload the document to your webserver so that the format is preserved. Some text editors won't save in UTF-8 format. Windows users might want to look at TextPad, which supports UTF-8. As  Mac user, I prefer BBEdit.
When FTPing your file up to the server, make sure that the file format is preserved. In some FTP clients, this might mean that you need to FTP the file up to the server as binary file.

THIS IS JUST THE BEGINNING

There are plenty more things which can trip you up on the way to UTF-8 goodness, but these are the basics. If you have a problem trying to display extended character sets, it can usually be traced to a problem somewhere in your document encoding, be it the source files, server headers, or even the database. Good luck. We hope that this article has helped!

0 nhận xét:

About

Chúng tôi là đội ngũ làm website, marketting online chuyên nghiệp. Trang thông tin chính thức của chúng tôi là myhoian.com. Đến với chúng tôi , bạn sẽ nhận được sự tư vấn tin cậy, trang web ưng ý, sự hỗ trợ thân thiện.

Nhận xét

Loading...
.loadingxrcm {background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1MbDICVINdJ2VOosI42WTFoAQWoWaGfoipWxoo30hNjf_2HyKIijHyswYp7fpxP0suEDXGCBbpdbcz_GRDu31jodI_MaE91rtpc4e1lRMq1hqFTMMHHf7eNFLPKDVinbrMMEvttc_1kM/s1600/progress_ani.gif) no-repeat 50% 50%;width:32px;height:32px;display:block;margin:0 auto;text-indent:-9999px;} ul#kmtranimasi{text-align:left;font:normal normal 11px Verdana,Geneva,sans-serif} ul#kmtranimasi,ul#kmtranimasi li{margin:0;padding:0;list-style:none;overflow:hidden;position:relative} ul#kmtranimasi li{text-indent:0;height:90px;background:whiteSmoke;padding:0 8px;border:1px solid #DFDFDF;border-top:1px solid white} ul#kmtranimasi img{border-radius:9999px;overflow:hidden;background:#383838;border:0;float:left;margin:5px 5px 0 0} ul#kmtranimasi .ketkomt{overflow:hidden} ul#kmtranimasi .ketkomt a{display:block;color:white;font-weight:bold;overflow:hidden;background:#363636;border-radius:2px;float:left;padding:0 5px;margin: 5px 0 0 0;} ul#kmtranimasi .ketkomt span{font-size:8px;position:absolute;z-index:2;top:21px;border-radius:2px;display:block;line-height:14px;padding:0 5px;left:68px;background:white} ul#kmtranimasi p{margin:15px 0 0}

Contact Details

Mr Duan Tell: 0944210999 Email: thietkewebhoian@gmail.com Địa chỉ : 32/9 Nguyễn Duy Hiệu - Hội An