Copying and Pasting Chinese Input to GB18030 Web Forms

This section provides a test on copying and pasting Chinese input text from UTF-8 and Big5 Web pages to GB18030 encoded Web forms.

In this test, I wanted to see if IE allows me to copy and past Chinese characters from UTF-8 and Big5 Web pages to GB18030 encoded Web forms.

1. Ran IE with this URL: http://localhost/Web-Form-Input-Chinese-GB18030.php, and remove the default text from the input box.

2. Ran another IE window with this URL: http://localhost/Web-Form-Input-Chinese-Big5.php. Copy and paste the Chinese characters from this page to the input box of the GB18030 page. The Chinese characters shows up in the input box correctly.

3. Entered a forward slash (/) in the input box of the GB18030 page.

4. Ran another IE window with this URL: http://localhost/Web-Form-Input-Chinese-UTF8.php. Copied and pasted the Chinese characters from this page to the input box of the GB18030 page. The Chinese characters showed up in the input box correctly.

6. Clicked the Submit button on the GB18030 page. The pasted characters were received and returned back to the returning Web page. The returned Chinese characters showed up correctly.

Copying and Pasting Chinese Characters to GB18030 Pages
Copying and Pasting Chinese Characters to GB18030 Pages

The returning page URL also confirmed that Chinese characters were copied and pasted correctly. Notice that GB18030 contains traditional Chinese characters. One of traditional characters has a special encoding: 0x9943, corresponding to %99C:

http://localhost/Web-Form-Input-Chinese-GB18030.php
  ?Input=%EB%8A%D2%95%99C%2F%B5%E7%CA%D3%BB%FA%2F%EB%8A%D2%95%99C
  &Submit=Submit

As a reference, here is the Chinese text in Hex numbers received by the PHP script:

EB8AD29599432FB5E7CAD3BBFA2FEB8AD2959943

This test shows that IE is smart, it automatically converts the pasted Chinese characters from UTF-8 and Big5 encoding to GB18030 encoding in a Web page form encoded as GB18030.

Table of Contents

 About This Book

 PHP Installation on Windows Systems

 Integrating PHP with Apache Web Server

 charset="*" - Encodings on Chinese Web Pages

 Chinese Characters in PHP String Literals

 Multibyte String Functions in UTF-8 Encoding

 Input Text Data from Web Forms

Input Chinese Text Data from Web Forms

 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

 MySQL - Installation on Windows

 MySQL - Connecting PHP to Database

 MySQL - Character Set and Encoding

 MySQL - Sending Non-ASCII Text to MySQL

 Retrieving Chinese Text from Database to Web Pages

 Input Chinese Text Data to MySQL Database

 Chinese Text Encoding Conversion and Corruptions

 Archived Tutorials

 References

 Full Version in PDF/EPUB