turrier.fr

Source : ct|11.06.08

< Tutorials Computer, Multimedia, Chinese

Display Chinese characters in a html page

Introduction

The ASCII character set is frequently used in computing. It contains 256 characters among which are the characters used in the French language (A,B,C...a,b,c...1,2,3..). In this character set, every character is coded on a single byte (00 in FF in hexadecimal or 0 - 255 in decimal); it is the reason for which we cannot represent more than a maximum of 256 different characters with an ASCII coding. For example, with an ascii coding, the ";" is coded with the value 3B in hexadecimal. It is 3 x 16 + 11 = 59 in decimal. You can verify this with the tool Character Map of Windows.

image1

On his side, the Chinese language uses ideograms, the total number of these ideograms is very important ( several thousands) even if we limit ourselves to the simplified Chinese.To be able to code all these ideograms, and also all the characters of all the languages of the world, was created the unicode format.
In this format, a character is represented with 2 bytes (instead of 1 byte in the AsCii coding). This allows to represent about 65 000 characters, what is sufficient to be able to represent all the characters used by all the languages in the world (Asian, Arabic, Persian, Cyrillic).
To be able to display Chinese characters in a web page, you must:
- verify that your computer is equipped with the Windows multilanguage support;
- Write the Chinese characters in the html pages, using the unicode format
If the Windows multilanguage support is not installed on your computer, you cannot display Chinese characters in Web pages. In that case, only white squares (and not ideograms) will display.

image2

The Windows multilanguage support

If your computer is equipped with Windows Vista, it is probably that the Windows multilanguage support was installed at the same time as the operating system. On the other hand if your computer is equipped with Windows XP, it is possible that the Windows multilanguage support is not installed on your computer. To verify if the Windows multilanguage support is installed on your computer, click the Character map (table of the characters of Windows) (Start / All Programs / Accessories / System tools/ Character Map).

image3

If you do not find the Chinese fonts (SimHei, SimSun), it means that the Windows multilanguage support is not installed on your computer.

image4

In that case, to install the Windows multilanguage support on your computer, you must to go into the Control panel of Windows (Start menu / Control Panel) and to click the icon " Options régionales et linguistiques ".

image5

Check the option "Installer les fichiers pour les langues d'Extrême-Orient".

image6

It will then be asked to you to insert the CD of Windows XP into the CD drive. Do what's necessary.

image7

The installation of Windows the multilanguage support will run automatically.

image8

Once this one is ended, it will be asked to you to restart your computer so that the Windows multilanguage support will be operating. Now, if you consult the Characters Map, you will find the Chinese fonts SimSum and SimHei, as well as the associated ideograms.

image9

Write Chinese characters in html pages

Once the Windows multilanguage support is installed on your computer, Chinese characters display automatically in consulted Web pages. You can verify this by surfing on Web, on Asian sites for example. To write a Chinese character in a HTML page, you can directly write its unicode value, in hexadecimal. The following examples illustrate this simple solution.

Exemple 1
---------

image10

image11

Exemple 2
---------

image12

image13


Valid XHTML 1.0 Transitional

© http://turrier.fr (2007)