PHP Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 2.21

Handling Non ASCII Characters - Overview

Part:   1  2  3 

PHP Tutorials - Herong's Tutorial Notes © Dr. Herong Yang

Non ASCII Characters with MySQL

Inputting Non ASCII Characters

Controlling Response Header Lines

HTTP Request Variables

Sessions

Using Cookies

PHP SOAP Extension

PHP SOAP Extension - Server

Directories, Files and Images

Using MySQL with PHP

... Table of Contents

(Continued from previous part...)

Character Traveling Paths

In a typical Web based application, characters will travel from one part of the application to another part. Here are some possible paths characters may travel through.

From PHP file to Web browser: The following diagram illustrates steps that characters must travel from a PHP file to a browser screen. It also shows the computing technologies that are used at different steps:

A1. Key Sequences from keyboard
      |
      |- Text editor
      v
A2. PHP File
      |
      |- PHP CGI engine
      v
A3. HTML Document
      |
      |- Web server
      v
A4. HTTP Response
      |
      |- Internet TCP/IP Connection
      v
A5. HTTP Response
      |
      |- Web browser
      v
A6. Visual characters on the Screen

From Database to Web browser: The following diagram illustrates steps that characters must travel from a database table to a browser screen. It also shows the computing technologies that are used at different steps:

B1. Byte sequences in storage
      |
      |- Database server
      v
B2. Byte stream
      |
      |- Database connection driver
      v
B3. Byte stream
      |
      |- PHP Application
      v
B4. HTTP Response
      |
      |- Internet TCP/IP Connection
      v
B5. HTTP Response
      |
      |- Web browser
      v
B6. Visual characters on the Screen

From Web browser to Database: The following diagram illustrates steps that characters must travel from a Web browser to a database table. It also shows the computing technologies that are used at different steps:

C1. Key sequences on keyboard
      |
      |- Language input tool (optional)
      v
C2. Byte sequences
      |
      |- Browser input form
      v
C3: HTTP request
      |
      |- Internet TCP/IP Connection
      v 
C4. HTTP request
      |
      |- Web server
      v
C5. CGI variables and input stream 
      |
      |- PHP Application
      v
C6. PHP variables
      |
      |- Database connection driver
      v
C7. Byte stream
      |
      |- Database server
      v
C8. Byte sequence in storage

Since all computing technologies are using ASCII encoding by default, text of ASCII characters can safely travel through those steps without any issues.

However, for non ASCII characters, we have to watch out each steps carefully to make sure that characters are not damaged and are decoded correctly.

Now I will try to provide some tutorials in this chapter and next 5 chapters to show you how to handle characters correctly in different steps of different connection paths.

(Continued on next part...)

Part:   1  2  3 

Dr. Herong Yang, updated in 2006
PHP Tutorials - Herong's Tutorial Notes - Handling Non ASCII Characters - Overview