Building Chinese Web Sites using PHP
Dr. Herong Yang, Version 2.11

Steps and Components Involved

This section describes steps and application components involved in inputting Chinese characters through Web forms.

In order to capture Chinese input text from Web forms and display it back on Web pages properly, you need to understand how an input text is being collected by the Web browser, and delivered to the PHP engine through various application components. Here is a simplified diagram that shows the steps and application components involved in this process:

C1. Key Sequences from keyboard
      |
      |- Web browser
      v
C2. HTTP Request
      |
      |- Web server
      v
C3. CGI input
      |
      |- PHP engine
      v
C4. CGI output
      |
      |- Web server
      v
C5. HTTP response (HTML document)
      |
      |- Web browser
      v
C6. Chinese characters on the screen

If you decided to use UTF-8 encoding to handle Chinese characters, you need to make sure that all application components mentioned in the above diagram are friendly to UTF-8 encoding. See the following picture:
Inputting Chinese Characters on Web Forms

Sections in This Chapter

Steps and Components Involved

Processing Chinese Input on Web Forms in UTF-8

Processing Chinese Input on Web Forms in GB18030

Processing Chinese Input on Web Forms in Big5

Copying and Pasting Chinese Input to UTF-8 Web Forms

Copying and Pasting Chinese Input to GB18030 Web Forms

Copying and Pasting Chinese Input to Big5 Web Forms

Dr. Herong Yang, updated in 2007
Steps and Components Involved