PHP Tutorials - Tutorial Addendum - Non ASCII Characters as Cord Literals
| |
(Continued from antecedent part...)
French Characters in Cord Literals - UTF-8 Encoding
First, let s play to some French characters in UTF-8 encoding first.
1. On a Windows system, run Alpha > All Programs > Accessories > Notepad.
2. In Notepad, access the afterward PHP script:
<?php #HelpUtf8French.php
# Absorb (c) 2005 by Dr. Yang, http://www.yang.com/
#
print( <html> );
print( <meta http-equiv="Content-Type" .
content="text/html; charset=utf-8"/> );
print( <body> );
print( <b>Help</b><br/> );
print( English: Arrangement amount is actual high.<br/> );
print( French: L utilisation de systme est trs haute.<br/> );
print( </body> );
print( </html> );
?>
3. To access the French character, "e with grave", you can run Alpha >
All Programs > Arrangement Accoutrement > Appearance Map. Baddest "e with grave" on the appearance map.
Click the Baddest button, then the Archetype button. Go aback to your Block and bang Ctrl-V
to adhesive "e with grave" into your PHP script.
4. Baddest card book > Save as. Access the book name as HelpUtf8French.php. Baddest "UTF-8"
in the encoding acreage and bang the Save button.
5. Archetype HelpUtf8French.php to c:inetpubwwwroot. Create abiding your Internet
Information Account is active the bounded absence Web site.
6. Now run Internet Explorer (IE) with http://localhost/HelpUtf8French.php.
Your should see the French characters displayed accurately as apparent below:
Help
English: Arrangement amount is actual high.
French: L utilisation de systme est trs haute.
7. On the IE window, baddest card Appearance > Encoding. You should see UTF-8 is selected.
Another absorbing affair you should understand is about how Block food a UTF-8 file. If you use UTF-8
encoding to abundance a book in Notepad, it will admit a UTF-8 brand (3 bytes) at the alpha of the file.
Use the "type" command in a command window, you will see this:
>type HelpUtf8French.php
n++<?php #HelpUtf8French.php
# Absorb (c) 2005 by Dr. Yang, http://www.yang.com/
#
print( <html> );
print( <meta http-equiv="Content-Type" .
content="text/html; charset=utf-8"/> );
print( <body> );
print( <b>Help</b><br/> );
print( English: Arrangement amount is actual high.<br/> );
print( French: L utilisation de syst+me est tr+s haute.<br/> );
print( </body> );
print( </html> );
?>
The hex amount of the UTF-8 brand is 0xEFBBBF. IIS server will forward it the client. IE browser will not appearance it
on the page, but it will use it to ascertain the encoding schema, if needed. Not abiding on how additional browsers will behave
this marker.
Working, right?
French Characters in Cord Literals - ISO-8859-1 Encoding
Now we understand how to create French characters alive in a PHP cord accurate in UTF-8 encoding schema.
Next let s see how to them alive in ISO-8859-1 encoding schema.
1. On a Windows system, run Alpha > All Programs > Accessories > Notepad.
2. In Notepad, access the afterward PHP script:
<?php #HelpIsoFrench.php
# Absorb (c) 2005 by Dr. Yang, http://www.yang.com/
#
print( <html> );
print( <meta http-equiv="Content-Type" .
content="text/html; charset=iso-8859-1"/> );
print( <body> );
print( <b>Help</b><br/> );
print( English: Arrangement amount is actual high.<br/> );
print( French: L utilisation de systme est trs haute.<br/> );
print( </body> );
print( </html> );
?>
(Continued on next part...)
|
print, french, system, characters, notepad, helputf8french, content, encoding, string, select, literals, utilisation, haute, grave, character, button, working, schema, marker, click, english, copyright, script, start, equiv, charset, programs, help<, systme, , print <, < body, < html, helputf8french php, french characters, string literals, system load, print english, content text, text html, html charset, print french, haute <, encoding schema, iso 8859, trs haute, est trs, type content, systme est, english system, http equiv, yang http, http www, php copyright, < php, start all, php script, www yang, yang com, meta http, equiv content, < meta, html print, com print, content type, < body print, type content text, content type content, content text html, text html charset, print english system, equiv content type, english system load, http equiv content, < meta http, < html print, meta http equiv, tutorials tutorial notes, non ascii characters, programs accessories notepad, php tutorials tutorial, |
Also see ...
i(Continued from antecedent part...)/i3. To access the French character, "e with grave", you can run Alpha All Programs Arrangement Accoutrement Appearance Map. Baddest "e with grave" on the appearance map.C
i(Continued from antecedent part...)/iChinese Characters in Cord Literals GB2312 EncodingI anticipate we are accessible to analysis Chinese characters in PHP scripts with GB2312 e
i(Continued from antecedent part...)/i3. Don t try to access those accost letters yourself. Go to the Google accent apparatus site,http://www.google.com/language_tools. You can access "Hello world!" and construe it to a
This affiliate explains:Storing Non ASCII Characters in DatabaseTransmitting Non ASCII Characters to the ServerMySqlUnicode.php UTF 8 Sample Script/ul
i(Continued from antecedent part...)/iTransmitting Non ASCII Characters to the ServerHandling non ASCII characters with MySQL not alone requires us ambience up the table columns
i(Continued from antecedent part...)/iIf you run it, you will get: Default settings... character_set_client latin1 character_set_connection latin1 character_set_data
This affiliate explains:What Is Localization / Internationalization?Managing Characters in Web Based Applications Character Traveling PathsASCII Char
i(Continued from antecedent part...)/iCharacter Traveling PathsIn a archetypal Web based application, characters will biking from one allotment of the appliance to addition part. b
i(Continued from antecedent part...)/iASCII Characters in PHP PagesAs I mentioned earlier, ASCII characters can biking from PHP files to browsers easily after any trouble. Ac
This affiliate explains:"mbstring" Extension"mbstring" Functions"mbstring" Basal TestsHTTP Ascribe and Achievement Encodingb