Entering Latin1 Characters with Alt Keycodes

This section describes how to enter Latin1 characters with Alt keycodes on an English keyboard.

In the previous example, the default Latin1 characters in the input text box were pre-generated by the PHP script using Latin1 code values.

If you are using an European key board, you can easily enter some text in European languages to test my Latin1 test PHP Web page form.

But if you are using an English key board, it is not easy to enter any special characters used in some European languages. One way to Latin1 characters on a Windows system is to use Alt key codes in the following key sequence:

<Alt>+0nnn
   <Alt>+ means pressing and holding down the Alt key.
   0nnn means pressing 0 and one, two or three numeric keys
      on the numeric key pad.
   Release the Alt key after numeric keys.

To use numeric keys on the numeric key pad, the "num lock" must be turned on by pressing the "num lock" key.

The numeric keys pressed present the decimal value of any Latin1 character code. The leading 0 is important. If you skip the leading 0, you Windows will take the Alt key codes as Windows 1252 encoding.

The table below shows you Latin1 special characters with code values between 0x80 and 0xFF:

Latin1 characters between 0x80 and 0xFF
---------------------------------------
Alt keycode C Hex     Alt keycode C Hex
                     
<Alt>+0128  € 0x80    <Alt>+0129  C 0x81
<Alt>+0130  ‚ 0x82    <Alt>+0131  ƒ 0x83
<Alt>+0132  „ 0x84    <Alt>+0133  … 0x85
<Alt>+0134  † 0x86    <Alt>+0135  ‡ 0x87
<Alt>+0136  ˆ 0x88    <Alt>+0137  ‰ 0x89
<Alt>+0138  Š 0x8A    <Alt>+0139  ‹ 0x8B
<Alt>+0140  Π0x8C    <Alt>+0141  C 0x8D
<Alt>+0142  Ž 0x8E    <Alt>+0143  C 0x8F
<Alt>+0144  C 0x90    <Alt>+0145  ‘ 0x91
<Alt>+0146  ’ 0x92    <Alt>+0147  “ 0x93
<Alt>+0148  ” 0x94    <Alt>+0149  • 0x95
<Alt>+0150  – 0x96    <Alt>+0151  — 0x97
<Alt>+0152  ˜ 0x98    <Alt>+0153  ™ 0x99
<Alt>+0154  š 0x9A    <Alt>+0155  › 0x9B
<Alt>+0156  œ 0x9C    <Alt>+0157  C 0x9D
<Alt>+0158  ž 0x9E    <Alt>+0159  Ÿ 0x9F
<Alt>+0160  S 0xA0    <Alt>+0161  ¡ 0xA1
<Alt>+0162  ¢ 0xA2    <Alt>+0163  £ 0xA3
<Alt>+0164  ¤ 0xA4    <Alt>+0165  ¥ 0xA5
<Alt>+0166  ¦ 0xA6    <Alt>+0167  § 0xA7
<Alt>+0168  ¨ 0xA8    <Alt>+0169  © 0xA9
<Alt>+0170  ª 0xAA    <Alt>+0171  « 0xAB
<Alt>+0172  ¬ 0xAC    <Alt>+0173  H 0xAD
<Alt>+0174  ® 0xAE    <Alt>+0175  ¯ 0xAF
<Alt>+0176  ° 0xB0    <Alt>+0177  ± 0xB1
<Alt>+0178  ² 0xB2    <Alt>+0179  ³ 0xB3
<Alt>+0180  ´ 0xB4    <Alt>+0181  µ 0xB5
<Alt>+0182  ¶ 0xB6    <Alt>+0183  · 0xB7
<Alt>+0184  ¸ 0xB8    <Alt>+0185  ¹ 0xB9
<Alt>+0186  º 0xBA    <Alt>+0187  » 0xBB
<Alt>+0188  ¼ 0xBC    <Alt>+0189  ½ 0xBD
<Alt>+0190  ¾ 0xBE    <Alt>+0191  ¿ 0xBF
<Alt>+0192  À 0xC0    <Alt>+0193  Á 0xC1
<Alt>+0194  Â 0xC2    <Alt>+0195  Ã 0xC3
<Alt>+0196  Ä 0xC4    <Alt>+0197  Å 0xC5
<Alt>+0198  Æ 0xC6    <Alt>+0199  Ç 0xC7
<Alt>+0200  È 0xC8    <Alt>+0201  É 0xC9
<Alt>+0202  Ê 0xCA    <Alt>+0203  Ë 0xCB
<Alt>+0204  Ì 0xCC    <Alt>+0205  Í 0xCD
<Alt>+0206  Î 0xCE    <Alt>+0207  Ï 0xCF
<Alt>+0208  Ð 0xD0    <Alt>+0209  Ñ 0xD1
<Alt>+0210  Ò 0xD2    <Alt>+0211  Ó 0xD3
<Alt>+0212  Ô 0xD4    <Alt>+0213  Õ 0xD5
<Alt>+0214  Ö 0xD6    <Alt>+0215  × 0xD7
<Alt>+0216  Ø 0xD8    <Alt>+0217  Ù 0xD9
<Alt>+0218  Ú 0xDA    <Alt>+0219  Û 0xDB
<Alt>+0220  Ü 0xDC    <Alt>+0221  Ý 0xDD
<Alt>+0222  Þ 0xDE    <Alt>+0223  ß 0xDF
<Alt>+0224  à 0xE0    <Alt>+0225  á 0xE1
<Alt>+0226  â 0xE2    <Alt>+0227  ã 0xE3
<Alt>+0228  ä 0xE4    <Alt>+0229  å 0xE5
<Alt>+0230  æ 0xE6    <Alt>+0231  ç 0xE7
<Alt>+0232  è 0xE8    <Alt>+0233  é 0xE9
<Alt>+0234  ê 0xEA    <Alt>+0235  ë 0xEB
<Alt>+0236  ì 0xEC    <Alt>+0237  í 0xED
<Alt>+0238  î 0xEE    <Alt>+0239  ï 0xEF
<Alt>+0240  ð 0xF0    <Alt>+0241  ñ 0xF1
<Alt>+0242  ò 0xF2    <Alt>+0243  ó 0xF3
<Alt>+0244  ô 0xF4    <Alt>+0245  õ 0xF5
<Alt>+0246  ö 0xF6    <Alt>+0247  ÷ 0xF7
<Alt>+0248  ø 0xF8    <Alt>+0249  ù 0xF9
<Alt>+0250  ú 0xFA    <Alt>+0251  û 0xFB
<Alt>+0252  ü 0xFC    <Alt>+0253  ý 0xFD
<Alt>+0254  þ 0xFE    <Alt>+0255  ÿ 0xFF

C - Stands for control characters
S - Stands for the non-breaking space character
H - Stands for the soft hyphen (invisible dash) character

Testing on Alt keycodes with Internet Explorer (IE) is provided in the next section.

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

 Steps and Components Involved

 Processing Web Form Input in ASCII

 Processing Web Form Input in Latin1 Encoding Error

 Processing Web Form Input in Latin1

Entering Latin1 Characters with Alt Keycodes

 Testing Latin1 Alt Keycodes with IE

 Processing Web Form Input in UTF-8

 Outputting Form Default Input Text in UTF-8

 Testing Alt Keycodes with IE on a UTF-8 Web Page

 Input Chinese Text Data from 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