Follow this Blog!

Jan 29, 2011

f Comment

How to Let Browser Know My Webpage Is Written in Chinese!

Amazon If your web page containing Chinese characters is rendered like the following screenshot in Google Chrome web browser or any modern browser then READ ON to see a solution!

Browser Showing Garbage Characters Due To Bad Encoding

Problem
It'd be nice if everything in today's world was written in English, but it's not the case. Mandarin Chinese is the second most popular language in the world, and there have been countless frustrations for Chinese webmasters to put up HTML website written in Chinese. They put some Chinese characters in the web page but when they load it in a browser they see gibberish or garbage. This is because the browser is not told to display the web page in Chinese encoding.

Let's see what you need to do to make browsers show your web pages in Mandarin automatically!

Solution
First of all to show Chinese characters you need to decide what encoding your webpage uses. You have two choices: UTF-8 or Big5. UTF-8 is universal encoding which you can use to write your web pages in any language. However most Chinese websites use Big5 to render Chinese characters because it is more common and more specific and browsers are more likely to interpret it correctly. So let's focus on using big5 as the encoding for your website to display Chinese words. Here are two things you need to do:

1. Include the Correct Encoding
Include the correct encoding tag in your HTML. In your <head> element include the following HTML tag:

<meta http-equiv="content-type" content="text/html; charset=big5"/>
This gives the browser the cue that this web page is written in Big5.

2. Make Sure File Encoding is Correct
Save your web pages in the appropriate encoding. If you are using Microsoft Notepad save your page as ANSI format, as the following photo suggests.

Use Ansi As File Encoding To Render Big5 Chinese Characters

That's it! You should be able to render your web pages in any modern web browser in Chinese by default as the following:

Browser Showing Chinese Characters With Correct Encoding

Such browsers include IE6, IE7, IE8, Firefox 2, Firefox 3, Chrome, Safari. If you have questions let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
Find Michael on Google or Facebook
ADVERTISING WITH US - Direct your advertising requests to Michael