cvs: presentations / php-ticks.xml php6-unicode.xml /slides/i18nl10n array-keys.xml basics-1.xml challenges.xml challenges2.xml
characters-not-bytes.xml composition.xml conversion.xml definitions1.xml definitions2.xml encoding-overview.png encoding-overview.xml
fallback-encoding.xml filename-encoding.xml goals-1.xml http-input-encoding.xml http-output-encoding.xml icu.xml php-can-do-it-now.xml php-in-html.xml
php-now-iconv.xml php-now-locales.xml php-now-mbstring.xml properties.xml resources.xml roadmap.xml runtime-encoding.xml script-encoding-pragma.xml
script-encoding.xml sorting.xml stream-encoding.xml string-binary.xml string-escape.xml string-literals.xml string-types.xml surrogates.xml
unicode-semantics.xml upgrading-functions.xml what-languages.xml /slides/internals figure1.png figure10.png figure2.png figure3.png figure4.png
figure5.png figure6.png figure7.png figure8.png figure9.png object-php4.png object-php5.png variables1.xml variables10.xml variables2.xml
variables3.xml variables4.xml variables5.xml variables6.xml variables7.xml variables8.xml variables9.xml
| From: | Derick Rethans | Date: | Fri, 09 Sep 2005 15:04:36 +0000 |
| Subject: | cvs: presentations / php-ticks.xml php6-unicode.xml /slides/i18nl10n array-keys.xml basics-1.xml challenges.xml challenges2.xml characters-not-bytes.xml composition.xml conversion.xml definitions1.xml definitions2.xml encoding-overview.png encoding-overview.xml fallback-encoding.xml filename-encoding.xml goals-1.xml http-input-encoding.xml http-output-encoding.xml icu.xml php-can-do-it-now.xml php-in-html.xml php-now-iconv.xml php-now-locales.xml php-now-mbstring.xml properties.xml resources.xml roadmap.xml runtime-encoding.xml script-encoding-pragma.xml script-encoding.xml sorting.xml stream-encoding.xml string-binary.xml string-escape.xml string-literals.xml string-types.xml surrogates.xml unicode-semantics.xml upgrading-functions.xml what-languages.xml /slides/internals figure1.png figure10.png figure2.png figure3.png figure4.png figure5.png figure6.png figure7.png figure8.png figure9.png object-php4.png object-php5.png variables1.xml variables10.xml variables2.xml variables3.xml variables4.xml variables5.xml variables6.xml variables7.xml variables8.xml variables9.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1184@lists.php.net to get a copy of this message | ||
derick Fri Sep 9 11:04:36 2005 EDT
Added files:
/presentations php-ticks.xml php6-unicode.xml
/presentations/slides/i18nl10n array-keys.xml basics-1.xml
challenges.xml challenges2.xml
characters-not-bytes.xml
composition.xml conversion.xml
definitions1.xml definitions2.xml
encoding-overview.png
encoding-overview.xml
fallback-encoding.xml
filename-encoding.xml goals-1.xml
http-input-encoding.xml
http-output-encoding.xml icu.xml
php-can-do-it-now.xml
php-in-html.xml php-now-iconv.xml
php-now-locales.xml
php-now-mbstring.xml properties.xml
roadmap.xml runtime-encoding.xml
script-encoding-pragma.xml
script-encoding.xml sorting.xml
stream-encoding.xml
string-binary.xml string-escape.xml
string-literals.xml string-types.xml
surrogates.xml unicode-semantics.xml
upgrading-functions.xml
what-languages.xml
/presentations/slides/internals figure1.png figure10.png
figure2.png figure3.png figure4.png
figure5.png figure6.png figure7.png
figure8.png figure9.png
object-php4.png object-php5.png
variables1.xml variables10.xml
variables2.xml variables3.xml
variables4.xml variables5.xml
variables6.xml variables7.xml
variables8.xml variables9.xml
Modified files:
/presentations/slides/i18nl10n resources.xml
Log:
- Added first bit of php6 unicode talk
- Added references/variables slides
http://cvs.php.net/diff.php/presentations/slides/i18nl10n/resources.xml?r1=1.3&r2=1.4&ty=u Index: presentations/slides/i18nl10n/resources.xml diff -u presentations/slides/i18nl10n/resources.xml:1.3 presentations/slides/i18nl10n/resources.xml:1.4 --- presentations/slides/i18nl10n/resources.xml:1.3 Tue Apr 26 10:52:53 2005 +++ presentations/slides/i18nl10n/resources.xml Fri Sep 9 11:04:35 2005 @@ -4,6 +4,7 @@ <image align="center" filename="multi-langual-development-trans.png" /> <break lines="4"/> + <link fontsize="2.4em" leader="Collation: " href="http://www.dbazine.com/db2/db2-disarticles/gulutzan1" target="_new"/> <link fontsize="2.4em" marginleft="0em" leader="This presentation: " href="http://derickrethans.nl/talks.php" target="_new"/> <link fontsize="3em" marginleft="0em" leader="Questions?: " href="dr@ez.no" target="_new"/> </slide> http://cvs.php.net/co.php/presentations/php-ticks.xml?r=1.1&p=1 Index: presentations/php-ticks.xml +++ presentations/php-ticks.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Internals</topic> <title>How PHP Ticks</title> <event>php|works 2005</event> <location>Toronto, Canada</location> <date>September 15th, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/internals/title.xml</slide> <slide>slides/internals/intro.xml</slide> <slide>slides/internals/clearness.xml</slide> <slide>slides/internals/apache-module.xml</slide> <slide>slides/internals/cgi.xml</slide> <slide>slides/internals/parse_error.xml</slide> <slide>slides/internals/lex.xml</slide> <slide>slides/internals/tokens.xml</slide> <slide>slides/internals/alltokens.xml</slide> <slide>slides/internals/tokenizer1.xml</slide> <slide>slides/internals/tokenizer2.xml</slide> <slide>slides/internals/compile.xml</slide> <slide>slides/internals/opcode2.xml</slide> <slide>slides/internals/opcode.xml</slide> <slide>slides/internals/vld-example.xml</slide> <slide>slides/internals/vld1.xml</slide> <slide>slides/internals/vld2.xml</slide> <slide>slides/internals/execute1.xml</slide> <slide>slides/internals/execute2.xml</slide> <slide>slides/internals/execute3.xml</slide> <slide>slides/internals/execute4.xml</slide> <!-- CACHES --> <slide>slides/perf/how_ccache.xml</slide> <slide>slides/perf/accelerators.xml</slide> <!-- Accelerators --> <!-- VARIABLES --> <slide>slides/internals/variables1.xml</slide> <slide>slides/internals/variables2.xml</slide> <slide>slides/internals/variables3.xml</slide> <slide>slides/internals/variables4.xml</slide> <slide>slides/internals/variables5.xml</slide> <slide>slides/internals/variables6.xml</slide> <slide>slides/internals/variables7.xml</slide> <slide>slides/internals/variables8.xml</slide> <slide>slides/internals/variables9.xml</slide> <slide>slides/internals/variables10.xml</slide> <slide>slides/internals/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/php6-unicode.xml?r=1.1&p=1 Index: presentations/php6-unicode.xml +++ presentations/php6-unicode.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Localization and Internationalization</topic> <title>PHP 6 and Unicode</title> <event>php|works 2005</event> <location>Toronto, Canada</location> <date>September 15th, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/clustering/title.xml</slide> <!-- CHARSETS --> <slide>slides/i18nl10n/what-languages.xml</slide> <!-- what is the problem actually? --> <slide>slides/i18nl10n/definitions1.xml</slide> <slide>slides/i18nl10n/definitions2.xml</slide> <!-- THE CHALLENGE --> <slide>slides/i18nl10n/challenges.xml</slide> <slide>slides/i18nl10n/challenges2.xml</slide> <slide>slides/i18nl10n/sorting.xml</slide> <slide>slides/i18nl10n/convert.xml</slide> <!-- PHP NOW --> <slide>slides/i18nl10n/php-can-do-it-now.xml</slide> <slide>slides/i18nl10n/php-now-iconv.xml</slide> <slide>slides/i18nl10n/php-now-mbstring.xml</slide> <slide>slides/i18nl10n/php-now-locales.xml</slide> <!-- UNICODE --> <slide>slides/i18nl10n/unicode.xml</slide> <slide>slides/i18nl10n/composition.xml</slide> <slide>slides/i18nl10n/properties.xml</slide> <!-- PHP SOON --> <slide>slides/i18nl10n/goals-1.xml</slide> <slide>slides/i18nl10n/basics-1.xml</slide> <slide>slides/i18nl10n/surrogates.xml</slide> <!-- how does the encoding work? --> <slide>slides/i18nl10n/icu.xml</slide> <slide>slides/i18nl10n/roadmap.xml</slide> <slide>slides/i18nl10n/unicode-semantics.xml</slide> <!-- STRINGS --> <slide>slides/i18nl10n/string-types.xml</slide> <slide>slides/i18nl10n/string-literals.xml</slide> <slide>slides/i18nl10n/string-binary.xml</slide> <slide>slides/i18nl10n/string-escape.xml</slide> <!-- DIFFERENT ENCODINGS --> <slide>slides/i18nl10n/encoding-overview.xml</slide> <slide>slides/i18nl10n/script-encoding.xml</slide> <slide>slides/i18nl10n/script-encoding-pragma.xml</slide> <slide>slides/i18nl10n/runtime-encoding.xml</slide> <slide>slides/i18nl10n/http-input-encoding.xml</slide> <slide>slides/i18nl10n/http-output-encoding.xml</slide> <slide>slides/i18nl10n/fallback-encoding.xml</slide> <!-- CONVERSIONS --> <slide>slides/i18nl10n/conversion.xml</slide> <slide>slides/i18nl10n/characters-not-bytes.xml</slide> <!-- ARRAY KEYS --> <slide>slides/i18nl10n/array-keys.xml</slide> <!-- INLINE HTML --> <slide>slides/i18nl10n/php-in-html.xml</slide> <!-- PHP's STRING FUNCTIONS --> <slide>slides/i18nl10n/upgrading-functions.xml</slide> <!-- LOCALES --> <!-- EXIT --> <slide>slides/i18nl10n/resources.xml</slide> <!-- resources --> </presentation> http://cvs.php.net/co.php/presentations/slides/i18nl10n/array-keys.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/array-keys.xml +++ presentations/slides/i18nl10n/array-keys.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Array Keys</title> <list> <bullet>All string types can be used as array keys.</bullet> <bullet>Behavior depends on %unicode_semantics% setting.</bullet> </list> <blurb> With Unicode semantics on: </blurb> <list> <bullet>(string)"key" and (unicode)"key" index the same element</bullet> </list> <break/> <blurb> With Unicode semantics off: </blurb> <list> <bullet>(string)"key" and (unicode)"key" index a *different* element</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/basics-1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/basics-1.xml +++ presentations/slides/i18nl10n/basics-1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How is It Going To Work?</title> <list> <bullet>UTF-16 as internal encoding</bullet> <bullet>All functions and operators work on Normalized Composed Characters (NFC)</bullet> <bullet>All identifiers can contain Unicode characters</bullet> <bullet>Internationalization is explicit, not implicit</bullet> <bullet>You can turn off Unicode semantics if you don't need it</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/challenges.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/challenges.xml +++ presentations/slides/i18nl10n/challenges.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>l10n challenges</title> <subtitle>LocalizatioN</subtitle> <list> <bullet>A web application for multiple regions</bullet> <bullet>Support for search, sorting and breaking up text</bullet> <bullet>Support correct formats for dates, times, currency as used in each region</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/challenges2.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/challenges2.xml +++ presentations/slides/i18nl10n/challenges2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>i18n challenges</title> <subtitle>InternationalizatioN</subtitle> <list> <bullet>Support for multiple encodings: conversion, detection, processing...</bullet> <bullet>Support for multiple language in different encodings and scripts</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/characters-not-bytes.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/characters-not-bytes.xml +++ presentations/slides/i18nl10n/characters-not-bytes.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Characters, not Bytes!</title> <list> <bullet>All functions and operators work on Code Points (characters) and not Code Units (bytes)</bullet> <bullet>Backward compatible if you only used single byte encodings before</bullet> <bullet>This does create overhead though, as we need to scan through a whole string</bullet> </list> <blurb>String Indexes:</blurb> <example result="1"><![CDATA[<?php $string = "â¿æ"; // bytes are: 0xE9 0xBB 0x83 0xE6 0x97 0xAD echo $string[1]; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/composition.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/composition.xml +++ presentations/slides/i18nl10n/composition.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Building New Characters</title> <blurb>You can compose new characters from base characters with combining modifiers that use no "space".</blurb> <break/> <blurb>Equivalents:</blurb> <example><![CDATA[ Ã¥ != aÌ U+0041 != U+00C5 + U+030A]]></example> <break lines="3"/> <blurb>Alternative Order:</blurb> <example><![CDATA[a + Ì + Ì£ = áº]]></example> <break/> <example><![CDATA[a + Ì£ + Ì = áº]]></example> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/conversion.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/conversion.xml +++ presentations/slides/i18nl10n/conversion.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Conversion</title> <list> <bullet>There will never be any implicit conversion from or to Binary Strings.</bullet> <bullet>The setting %unicode.from_error_subst_char% can be used to specify a hex value that should be used if a character can not be converted.</bullet> </list> <blurb>Autoconversion of strings:</blurb> <example result="1"><![CDATA[<?php $native = (string) "blÃ¥bær"; var_inspect($native); echo "<br/>\n"; $native .= "øl"; var_inspect($native); ]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/definitions1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/definitions1.xml +++ presentations/slides/i18nl10n/definitions1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Definitions</title> <blurb>Character Set</blurb> <list> <bullet>A collection of characters used in a specific environment</bullet> </list> <break/> <blurb>Character Encoding Form</blurb> <list> <bullet>The representation of characters with integer numbers (code points)</bullet> </list> <break/> <blurb>Character Encoding Sequence</blurb> <list> <bullet>The digital representation of code points</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/definitions2.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/definitions2.xml +++ presentations/slides/i18nl10n/definitions2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Definitions</title> <subtitle>Examples</subtitle> <blurb>Character Set</blurb> <list> <bullet>a b c d e f g h i ... q r s t u v w x y z Ã¥ æ ø</bullet> <bullet>α β γ δ ε ζ η θ ι κ ... Ï Ï Ï Ï Ï Ï Ï</bullet> </list> <break/> <blurb>Character Encoding Form</blurb> <list> <bullet>iso-8859-1: a = *97*, ë = *235*</bullet> <bullet>iso-8859-7: a = *97*, α = *225*, Ï = *249*</bullet> <bullet>Unicode: a = *97*, ë = *235*, Ï = *969*</bullet> </list> <break/> <blurb>Character Encoding Sequence</blurb> <list> <bullet>iso-8859-1: a = *0x61*, ë = *0xEB*</bullet> <bullet>UTF-8: a = *0x61*, ë = *0xC3* *0xAB*, Ï = *0xCF* *0x89*</bullet> <bullet>UTF-16: a = *0x00 0x61*, ë = *0x00* *0xEB*, Ï = *0x03* *0xC9*</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/encoding-overview.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/encoding-overview.xml +++ presentations/slides/i18nl10n/encoding-overview.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Encodings Overview</title> <image align="center" filename="encoding-overview.png"/> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/fallback-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/fallback-encoding.xml +++ presentations/slides/i18nl10n/fallback-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Fallback Encoding</title> <list> <bullet>Used if any of the other encoding settings is not set</bullet> <bullet>Easy way of configuring all encoding settings</bullet> <bullet>Defaults to UTF-8 if it's not set</bullet> </list> <blurb>INI Settings Recap:</blurb> <example><![CDATA[unicode.script_encoding = "UTF-8" Source encoding for your script unicode.runtime_encoding = "iso-8859-15" Internal encoding used for "native strings" unicode.from_error_subst_char = "2f" Hex value of substitution character unicode.http_input_encoding = "UTF-8" Default encoding for HTTP input variables unicode.output_encoding = "UTF-8" Encoding used for script output unicode.fallback_encoding = "UTF-8" Fallback encoding]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/filename-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/filename-encoding.xml +++ presentations/slides/i18nl10n/filename-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Filename Encoding</title> <list> <bullet></bullet> </list> <example><![CDATA[]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/goals-1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/goals-1.xml +++ presentations/slides/i18nl10n/goals-1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>What Do We Want for PHP?</title> <list> <bullet>Native Unicode strings</bullet> <bullet>A clear separation between Binary, Native (Encoded) Strings and Unicode Strings</bullet> <bullet>Unicode string literals</bullet> <bullet>Updated language semantics</bullet> <bullet>Where possible, upgrade the existing functions</bullet> <bullet>Backwards compability</bullet> <bullet>PHP should do what most people will expect</bullet> <bullet>Make complex things possible, without making using strings in PHP complex</bullet> <bullet>Must be as good as Java's support</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/http-input-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/http-input-encoding.xml +++ presentations/slides/i18nl10n/http-input-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>HTTP Input Encoding</title> <list> <bullet>In Unicode mode, we need to make sure incoming HTTP variables are correctly converted to Unicode</bullet> <bullet>GET requests never come with encoding attached</bullet> <bullet>POST requests sometimes come with encoding attached, but it might be wrong</bullet> <bullet>If there is no encoding found, PHP can use the %http_input_encoding% setting</bullet> <bullet>Frequently the input variables are in the same encoding as the page where they where send from</bullet> <bullet>But sometimes not, so an application can ask to recode them</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/http-output-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/http-output-encoding.xml +++ presentations/slides/i18nl10n/http-output-encoding.xml <?xml version="1.0" encoding="iso-8859-1"?> <slide fontsize="6em"> <title>HTTP Output Encoding</title> <list> <bullet>Is used as encoding for the output of the script</bullet> <bullet>Script output is encoding on the fly</bullet> <bullet>Binary strings will never be automatically converted</bullet> </list> <blurb>On the fly encoding:</blurb> <example result="1"><![CDATA[<?php declare(encoding="iso-8859-1"); ini_set('unicode.output_encoding', 'utf-8'); $str = "rødbærsyltetøy<br/>"; $bstr = b"rødbærsyltetøy<br/>"; echo $str, $bstr; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/icu.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/icu.xml +++ presentations/slides/i18nl10n/icu.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How Will It Be Implemented?</title> <blurb>ICU: IBMs Components for Unicode</blurb> <list> <bullet>Unicode is extremely complex, with ICU we don't have to implement it ourselves</bullet> <bullet>ICU has a lot of features, is fast, stable, portable, extensible, Open Source and well maintained and supported</bullet> </list> <blurb>ICU Features</blurb> <list> <bullet>Character, String and Text processing</bullet> <bullet>Text Transformations</bullet> <bullet>Encoding Conversions</bullet> <bullet>Collation</bullet> <bullet>Localization: date, time, number, currency formatting</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-can-do-it-now.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-can-do-it-now.xml +++ presentations/slides/i18nl10n/php-can-do-it-now.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Do We Need Something New?</title> <list> <bullet>PHP only deals with bytes, not characters.</bullet> <bullet>PHP doesn't know anything about encodings.</bullet> <bullet>Having a binary image in a string is nice, but not if you need to deal with i18n</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-in-html.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-in-html.xml +++ presentations/slides/i18nl10n/php-in-html.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>PHP and HTML</title> <list> <bullet>PHP's strength is its embedding in HTML.</bullet> <bullet>These HTML blocks should be in the same encoding as the PHP script embedded in it.</bullet> <bullet>Embedded HTML will be converted to the output encoding.</bullet> </list> <break lines="2"/> <example result="1"><![CDATA[<?php $string = "â¿é»"; echo $string[0]; ?>æ<?php echo $string[1]; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-iconv.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-iconv.xml +++ presentations/slides/i18nl10n/php-now-iconv.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Iconv</title> <subtitle>Character Set Conversions</subtitle> <list> <bullet>Is part of glibc</bullet> <bullet>BSD requires an external library</bullet> <bullet>Enabled by default in PHP 5</bullet> <bullet>Supports 100s of character sets</bullet> </list> <div effect="hide"> <blurb>But it doesn't solve:</blurb> <blurb>|ff0000|localization, sorting, searching, encoding detection *and* you still work with binary data only!|</blurb> </div> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-locales.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-locales.xml +++ presentations/slides/i18nl10n/php-now-locales.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Anything Else That Sucks?</title> <subtitle>Locales in PHP</subtitle> <list> <bullet>Some of PHP's functions can make use of POSIX-locales</bullet> <bullet>But that's only a few of them</bullet> <bullet>Those locales are system dependent (different names, rules, etc...)</bullet> <bullet>They are not always available</bullet> </list> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-mbstring.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-mbstring.xml +++ presentations/slides/i18nl10n/php-now-mbstring.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>mbstring</title> <subtitle>Multi Byte Support!</subtitle> <list> <bullet>Handles certain encoding problems for you</bullet> <bullet>Updates string functions by "overloading" them</bullet> </list> <div effect="hide"> <blurb>But it doesn't solve:</blurb> <blurb>|ff0000|localization, sorting, searching *and* you still work with binary data only!|</blurb> </div> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/properties.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/properties.xml +++ presentations/slides/i18nl10n/properties.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Unicode Is More</title> <list> <bullet>Unicode is a multi-linguage character set</bullet> <bullet>Standard encodings: UTF-8, UTF-16 and UTF-32</bullet> <bullet>Defines algorithms for plenty of issues (Collation, Bidi, Normalization)</bullet> <bullet>It defines properties for characters:</bullet> </list> <example><![CDATA[à 00C5;LATIN CAPITAL LETTER A WITH RING ABOVE;Lu;0;L;0041 030A;;;; N;LATIN CAPITAL LETTER A RING;;;00E5; Ç 01C4;LATIN CAPITAL LETTER DZ WITH CARON;Lu;0;L;<compat> 0044 017D;;;; N;LATIN CAPITAL LETTER D Z HACEK;;;01C6;01C5 â« 212B;ANGSTROM SIGN;Lu;0;L;00C5;;;; N;ANGSTROM UNIT;;;00E5; ]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/roadmap.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/roadmap.xml +++ presentations/slides/i18nl10n/roadmap.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Roadmap</title> <list type="number"> <bullet>|008800|Support Unicode in the Engine|</bullet> <bullet>|008800|Upgrade exist||FF8800|ing functions|</bullet> <bullet>|008800|Add new| |FF8800|functions for explicit i18n/l10n support|</bullet> <bullet>|FF3300|Expose ICU's features|</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/runtime-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/runtime-encoding.xml +++ presentations/slides/i18nl10n/runtime-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Runtime Encoding</title> <list> <bullet>Determines which encoding to attach to Native Strings</bullet> <bullet>Also used when functions are not upgraded to support Unicode yet</bullet> </list> <break/> <blurb>Encoding problems:</blurb> <example result="1"><![CDATA[<?php ini_set('unicode.runtime_encoding', 'iso-8859-5'); ini_set('unicode.from_error_subst_char', '2D'); $food = 'blÃ¥bær != блабаÑ'; $food2 = (string) $food; $food3 = (unicode) $food2; echo $food, '<br/>', $food2, '<br/>', $food3, "<br/>\n"; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/script-encoding-pragma.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/script-encoding-pragma.xml +++ presentations/slides/i18nl10n/script-encoding-pragma.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <subtitle>Setting Script Encoding With declare()</subtitle> <blurb>Interpreting an iso-8859-1 script as UTF-8:</blurb> <example result="1"><![CDATA[<?php declare(encoding="iso-8859-1"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> <break lines="3"/> <blurb>Interpreting an UTF-8 script as UTF-8:</blurb> <example result="1"><![CDATA[<?php declare(encoding="utf-8"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/script-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/script-encoding.xml +++ presentations/slides/i18nl10n/script-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <list> <bullet>Is used by the parser to read in your script</bullet> <bullet>Determines how string literals and identifiers are handled</bullet> <bullet>Can be set with an ini setting (script_encoding) or with an inline "pragma"</bullet> <bullet>No matter what the script's encoding is, the resulting string is always a Unicode string (or identifier)</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/sorting.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/sorting.xml +++ presentations/slides/i18nl10n/sorting.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Sorting Strings</title> <subtitle>The French Are Weird</subtitle> <blurb> How would you sort: *côté* (side), *côte* (coast), *cote* (dimension), *coté* (with dimensions)? </blurb> <break/> <blurb> Logical is: cote, cot*é*, c*ô*te, c*ô*t*é* </blurb> <div effect="hide"> <break/> <blurb> But the french do it like: cote, c*ô*te, cot*é*, c*ô*t*é* </blurb> <break lines="4"/> <blurb>The french are not the only ones with "weird" sorting!</blurb> <list> <bullet>In Lithuanian, *y* is sorted between *i* and *k*.</bullet> <bullet>In traditional Spanish *ch* is treated as a single letter, and sorted between *c* and *d*.</bullet> <bullet>In Swedish *v* and *w* are considered variant forms of the same letter.</bullet> <bullet>In German dictionaries, *öf* would come before *of*. In phone books the situation is the exact opposite.</bullet> </list> </div> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/stream-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/stream-encoding.xml +++ presentations/slides/i18nl10n/stream-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Stream Encoding</title> <list> <bullet></bullet> </list> <example><![CDATA[]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-binary.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-binary.xml +++ presentations/slides/i18nl10n/string-binary.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>B1nary String Literals</title> <subtitle>string -> binary</subtitle> <list> <bullet>Binary string literals are explicit</bullet> <bullet>The actual variable's contents depend on the script encoding</bullet> </list> <example result="1"><![CDATA[<?php // script is encoded in UTF-8 function varc($s) { for ($i = 0; $i < strlen($s); ++$i) echo sprintf("%02X ", ord($s[$i])); echo "<br/>\n"; } $s1 = b'weed'; $s2 = b"qua\x72k"; $s3 = b<<<EOBS gold = é EOBS; echo varc($s1), varc($s2), varc($s3), "\n"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-escape.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-escape.xml +++ presentations/slides/i18nl10n/string-escape.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Literal Escapes</title> <blurb>When Unicode semantics are enabled, you can use the \uXXXX and \UXXXXXX escape sequences to specific Unicode code points</blurb> <break lines="2"/> <example result="1"><![CDATA[ <?php // script is encoded in UTF-8 $str = "é is equivalent with \u91d1<br/>\n"; echo $str, "<br/>\n"; echo "ð is equivalent with:<br/>\n"; echo "- \U010083<br/>\n"; echo "- \C{LINEAR B IDEOGRAM B105 EQUID}"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-literals.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-literals.xml +++ presentations/slides/i18nl10n/string-literals.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Literals</title> <subtitle>string -> string, unicode</subtitle> <blurb>Unicode Semantics are *off*:</blurb> <example><![CDATA[<?php // script is encoded in UTF-8 $str = "hallo daar!"; echo gettype($str), ': ', strlen($str), "\n"; $str = "пÑивеÑ!"; echo gettype($str), ': ', strlen($str), "\n"; ?>]]></example> <blurb>outputs:</blurb> <example>string: 11 string: 13</example> <break/> <blurb>Unicode Semantics are *on*:</blurb> <example><![CDATA[<?php // script is encoded in UTF-8 $str = "hallo daar!"; echo gettype($str), ': ', strlen($str), "\n"; $str = "пÑивеÑ!"; echo gettype($str), ': ', strlen($str), "\n"; ?>]]></example> <blurb>outputs:</blurb> <example>unicode: 11 unicode: 7</example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-types.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-types.xml +++ presentations/slides/i18nl10n/string-types.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Types</title> <list> <bullet>*binary*: Used to represent binary data, for example the contents of a JPEG file.</bullet> </list> <example>. P N G . . . . . . . . I H D R 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52</example> <break/> <list> <bullet>*string*: Native string, encoded with the current script's encoding. For backwards compatibility.</bullet> </list> <example>B l Ã¥ b æ r ø l 62 6C C3 A5 62 C3 A6 72 C3 A8 6C</example> <break/> <list> <bullet>*unicode*: Strings, internally encoded in UTF-16.</bullet> </list> <example>B l Ã¥ b æ r ø l 62 00 6C 00 E5 00 62 00 E6 00 72 00 F8 00 6C 00</example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/surrogates.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/surrogates.xml +++ presentations/slides/i18nl10n/surrogates.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>UTF 16 Surrogates</title> <blurb> As UTF-16 is supposed to encode the full Unicode character set. </blurb> <list> <bullet>UTF-16 uses a double two-byte sequence for characters outside the BMP</bullet> <bullet>Special ranges in the Unicode range are used for this</bullet> </list> <example><![CDATA[byte 1 = 1101 10yy yyyy yyyy byte 2 = 1101 11xx xxxx xxxx MUSICAL SYMBOL SIXTEENTH NOTE (0x1d161) 1101 10yy yyyy yyyy 1101 11xx xxxx xxxx ---- --++ +111 0100 ---- --01 0110 0001 ======================================== 1101 1000 0111 0100 1101 1101 0110 0001 0xd8 0x74 0xdd 0x61]]></example> <list> <bullet>Code *point*: a character</bullet> <bullet>Code *unit*: a two-byte sequence with UTF-16</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/unicode-semantics.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/unicode-semantics.xml +++ presentations/slides/i18nl10n/unicode-semantics.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How Do We Turn It On?</title> <list> <bullet>With an INI setting: %unicode_semantics%</bullet> <bullet>It can be turned on "per-request"</bullet> <bullet>(Almost) no behavioral changes when it's not enabled</bullet> <bullet>The setting does not mean you won't have any Unicode strings</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/upgrading-functions.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/upgrading-functions.xml +++ presentations/slides/i18nl10n/upgrading-functions.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Upgrading Functions</title> <list> <bullet></bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/what-languages.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/what-languages.xml +++ presentations/slides/i18nl10n/what-languages.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>What is this about anyway?</title> <list> <bullet>There is more than one country in the world</bullet> <bullet>Ce n'est pas tout le monde qui parle anglais</bullet> <bullet>Tjueseks karakterer holder ikke mÃ¥l</bullet> <bullet>ÐÐ¾Ñ ÑвÑибади из Ñзин Ð·Ñ ÑÑйм ÑкÑÐ¸Ð¿Ñ Ð¸Ð²Ñн</bullet> <bullet>It gets even more complicated with Chinese languages</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables1.xml?r=1.1&p=1 Index: presentations/slides/internals/variables1.xml +++ presentations/slides/internals/variables1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>The Symbol Table</subtitle> <image align="center" filename="figure1.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables10.xml?r=1.1&p=1 Index: presentations/slides/internals/variables10.xml +++ presentations/slides/internals/variables10.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Bad Return by Reference</subtitle> <image align="center" filename="figure10.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables2.xml?r=1.1&p=1 Index: presentations/slides/internals/variables2.xml +++ presentations/slides/internals/variables2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Introducing Refcounting</subtitle> <image align="center" filename="figure2.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables3.xml?r=1.1&p=1 Index: presentations/slides/internals/variables3.xml +++ presentations/slides/internals/variables3.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Refcounting and Passing Variables to Functions</subtitle> <image align="center" filename="figure3.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables4.xml?r=1.1&p=1 Index: presentations/slides/internals/variables4.xml +++ presentations/slides/internals/variables4.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Introducing References</subtitle> <image align="center" filename="figure4.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables5.xml?r=1.1&p=1 Index: presentations/slides/internals/variables5.xml +++ presentations/slides/internals/variables5.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Mixing Assign-By Value and Assign-by Reference</subtitle> <image align="center" filename="figure5.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables6.xml?r=1.1&p=1 Index: presentations/slides/internals/variables6.xml +++ presentations/slides/internals/variables6.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Mixing Assign-by Reference and Assign-by Value</subtitle> <image align="center" filename="figure6.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables7.xml?r=1.1&p=1 Index: presentations/slides/internals/variables7.xml +++ presentations/slides/internals/variables7.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Passing by Reference</subtitle> <image align="center" filename="figure7.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables8.xml?r=1.1&p=1 Index: presentations/slides/internals/variables8.xml +++ presentations/slides/internals/variables8.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Return by Reference</subtitle> <image align="center" filename="figure8.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables9.xml?r=1.1&p=1 Index: presentations/slides/internals/variables9.xml +++ presentations/slides/internals/variables9.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>The "global" Keyword</subtitle> <image align="center" filename="figure9.png" /> <!-- # vim: encoding=utf8 --> </slide>
http://cvs.php.net/diff.php/presentations/slides/i18nl10n/resources.xml?r1=1.3&r2=1.4&ty=u Index: presentations/slides/i18nl10n/resources.xml diff -u presentations/slides/i18nl10n/resources.xml:1.3 presentations/slides/i18nl10n/resources.xml:1.4 --- presentations/slides/i18nl10n/resources.xml:1.3 Tue Apr 26 10:52:53 2005 +++ presentations/slides/i18nl10n/resources.xml Fri Sep 9 11:04:35 2005 @@ -4,6 +4,7 @@ <image align="center" filename="multi-langual-development-trans.png" /> <break lines="4"/> + <link fontsize="2.4em" leader="Collation: " href="http://www.dbazine.com/db2/db2-disarticles/gulutzan1" target="_new"/> <link fontsize="2.4em" marginleft="0em" leader="This presentation: " href="http://derickrethans.nl/talks.php" target="_new"/> <link fontsize="3em" marginleft="0em" leader="Questions?: " href="dr@ez.no" target="_new"/> </slide> http://cvs.php.net/co.php/presentations/php-ticks.xml?r=1.1&p=1 Index: presentations/php-ticks.xml +++ presentations/php-ticks.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Internals</topic> <title>How PHP Ticks</title> <event>php|works 2005</event> <location>Toronto, Canada</location> <date>September 15th, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/internals/title.xml</slide> <slide>slides/internals/intro.xml</slide> <slide>slides/internals/clearness.xml</slide> <slide>slides/internals/apache-module.xml</slide> <slide>slides/internals/cgi.xml</slide> <slide>slides/internals/parse_error.xml</slide> <slide>slides/internals/lex.xml</slide> <slide>slides/internals/tokens.xml</slide> <slide>slides/internals/alltokens.xml</slide> <slide>slides/internals/tokenizer1.xml</slide> <slide>slides/internals/tokenizer2.xml</slide> <slide>slides/internals/compile.xml</slide> <slide>slides/internals/opcode2.xml</slide> <slide>slides/internals/opcode.xml</slide> <slide>slides/internals/vld-example.xml</slide> <slide>slides/internals/vld1.xml</slide> <slide>slides/internals/vld2.xml</slide> <slide>slides/internals/execute1.xml</slide> <slide>slides/internals/execute2.xml</slide> <slide>slides/internals/execute3.xml</slide> <slide>slides/internals/execute4.xml</slide> <!-- CACHES --> <slide>slides/perf/how_ccache.xml</slide> <slide>slides/perf/accelerators.xml</slide> <!-- Accelerators --> <!-- VARIABLES --> <slide>slides/internals/variables1.xml</slide> <slide>slides/internals/variables2.xml</slide> <slide>slides/internals/variables3.xml</slide> <slide>slides/internals/variables4.xml</slide> <slide>slides/internals/variables5.xml</slide> <slide>slides/internals/variables6.xml</slide> <slide>slides/internals/variables7.xml</slide> <slide>slides/internals/variables8.xml</slide> <slide>slides/internals/variables9.xml</slide> <slide>slides/internals/variables10.xml</slide> <slide>slides/internals/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/php6-unicode.xml?r=1.1&p=1 Index: presentations/php6-unicode.xml +++ presentations/php6-unicode.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Localization and Internationalization</topic> <title>PHP 6 and Unicode</title> <event>php|works 2005</event> <location>Toronto, Canada</location> <date>September 15th, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/clustering/title.xml</slide> <!-- CHARSETS --> <slide>slides/i18nl10n/what-languages.xml</slide> <!-- what is the problem actually? --> <slide>slides/i18nl10n/definitions1.xml</slide> <slide>slides/i18nl10n/definitions2.xml</slide> <!-- THE CHALLENGE --> <slide>slides/i18nl10n/challenges.xml</slide> <slide>slides/i18nl10n/challenges2.xml</slide> <slide>slides/i18nl10n/sorting.xml</slide> <slide>slides/i18nl10n/convert.xml</slide> <!-- PHP NOW --> <slide>slides/i18nl10n/php-can-do-it-now.xml</slide> <slide>slides/i18nl10n/php-now-iconv.xml</slide> <slide>slides/i18nl10n/php-now-mbstring.xml</slide> <slide>slides/i18nl10n/php-now-locales.xml</slide> <!-- UNICODE --> <slide>slides/i18nl10n/unicode.xml</slide> <slide>slides/i18nl10n/composition.xml</slide> <slide>slides/i18nl10n/properties.xml</slide> <!-- PHP SOON --> <slide>slides/i18nl10n/goals-1.xml</slide> <slide>slides/i18nl10n/basics-1.xml</slide> <slide>slides/i18nl10n/surrogates.xml</slide> <!-- how does the encoding work? --> <slide>slides/i18nl10n/icu.xml</slide> <slide>slides/i18nl10n/roadmap.xml</slide> <slide>slides/i18nl10n/unicode-semantics.xml</slide> <!-- STRINGS --> <slide>slides/i18nl10n/string-types.xml</slide> <slide>slides/i18nl10n/string-literals.xml</slide> <slide>slides/i18nl10n/string-binary.xml</slide> <slide>slides/i18nl10n/string-escape.xml</slide> <!-- DIFFERENT ENCODINGS --> <slide>slides/i18nl10n/encoding-overview.xml</slide> <slide>slides/i18nl10n/script-encoding.xml</slide> <slide>slides/i18nl10n/script-encoding-pragma.xml</slide> <slide>slides/i18nl10n/runtime-encoding.xml</slide> <slide>slides/i18nl10n/http-input-encoding.xml</slide> <slide>slides/i18nl10n/http-output-encoding.xml</slide> <slide>slides/i18nl10n/fallback-encoding.xml</slide> <!-- CONVERSIONS --> <slide>slides/i18nl10n/conversion.xml</slide> <slide>slides/i18nl10n/characters-not-bytes.xml</slide> <!-- ARRAY KEYS --> <slide>slides/i18nl10n/array-keys.xml</slide> <!-- INLINE HTML --> <slide>slides/i18nl10n/php-in-html.xml</slide> <!-- PHP's STRING FUNCTIONS --> <slide>slides/i18nl10n/upgrading-functions.xml</slide> <!-- LOCALES --> <!-- EXIT --> <slide>slides/i18nl10n/resources.xml</slide> <!-- resources --> </presentation> http://cvs.php.net/co.php/presentations/slides/i18nl10n/array-keys.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/array-keys.xml +++ presentations/slides/i18nl10n/array-keys.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Array Keys</title> <list> <bullet>All string types can be used as array keys.</bullet> <bullet>Behavior depends on %unicode_semantics% setting.</bullet> </list> <blurb> With Unicode semantics on: </blurb> <list> <bullet>(string)"key" and (unicode)"key" index the same element</bullet> </list> <break/> <blurb> With Unicode semantics off: </blurb> <list> <bullet>(string)"key" and (unicode)"key" index a *different* element</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/basics-1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/basics-1.xml +++ presentations/slides/i18nl10n/basics-1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How is It Going To Work?</title> <list> <bullet>UTF-16 as internal encoding</bullet> <bullet>All functions and operators work on Normalized Composed Characters (NFC)</bullet> <bullet>All identifiers can contain Unicode characters</bullet> <bullet>Internationalization is explicit, not implicit</bullet> <bullet>You can turn off Unicode semantics if you don't need it</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/challenges.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/challenges.xml +++ presentations/slides/i18nl10n/challenges.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>l10n challenges</title> <subtitle>LocalizatioN</subtitle> <list> <bullet>A web application for multiple regions</bullet> <bullet>Support for search, sorting and breaking up text</bullet> <bullet>Support correct formats for dates, times, currency as used in each region</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/challenges2.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/challenges2.xml +++ presentations/slides/i18nl10n/challenges2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>i18n challenges</title> <subtitle>InternationalizatioN</subtitle> <list> <bullet>Support for multiple encodings: conversion, detection, processing...</bullet> <bullet>Support for multiple language in different encodings and scripts</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/characters-not-bytes.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/characters-not-bytes.xml +++ presentations/slides/i18nl10n/characters-not-bytes.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Characters, not Bytes!</title> <list> <bullet>All functions and operators work on Code Points (characters) and not Code Units (bytes)</bullet> <bullet>Backward compatible if you only used single byte encodings before</bullet> <bullet>This does create overhead though, as we need to scan through a whole string</bullet> </list> <blurb>String Indexes:</blurb> <example result="1"><![CDATA[<?php $string = "â¿æ"; // bytes are: 0xE9 0xBB 0x83 0xE6 0x97 0xAD echo $string[1]; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/composition.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/composition.xml +++ presentations/slides/i18nl10n/composition.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Building New Characters</title> <blurb>You can compose new characters from base characters with combining modifiers that use no "space".</blurb> <break/> <blurb>Equivalents:</blurb> <example><![CDATA[ Ã¥ != aÌ U+0041 != U+00C5 + U+030A]]></example> <break lines="3"/> <blurb>Alternative Order:</blurb> <example><![CDATA[a + Ì + Ì£ = áº]]></example> <break/> <example><![CDATA[a + Ì£ + Ì = áº]]></example> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/conversion.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/conversion.xml +++ presentations/slides/i18nl10n/conversion.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Conversion</title> <list> <bullet>There will never be any implicit conversion from or to Binary Strings.</bullet> <bullet>The setting %unicode.from_error_subst_char% can be used to specify a hex value that should be used if a character can not be converted.</bullet> </list> <blurb>Autoconversion of strings:</blurb> <example result="1"><![CDATA[<?php $native = (string) "blÃ¥bær"; var_inspect($native); echo "<br/>\n"; $native .= "øl"; var_inspect($native); ]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/definitions1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/definitions1.xml +++ presentations/slides/i18nl10n/definitions1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Definitions</title> <blurb>Character Set</blurb> <list> <bullet>A collection of characters used in a specific environment</bullet> </list> <break/> <blurb>Character Encoding Form</blurb> <list> <bullet>The representation of characters with integer numbers (code points)</bullet> </list> <break/> <blurb>Character Encoding Sequence</blurb> <list> <bullet>The digital representation of code points</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/definitions2.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/definitions2.xml +++ presentations/slides/i18nl10n/definitions2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Definitions</title> <subtitle>Examples</subtitle> <blurb>Character Set</blurb> <list> <bullet>a b c d e f g h i ... q r s t u v w x y z Ã¥ æ ø</bullet> <bullet>α β γ δ ε ζ η θ ι κ ... Ï Ï Ï Ï Ï Ï Ï</bullet> </list> <break/> <blurb>Character Encoding Form</blurb> <list> <bullet>iso-8859-1: a = *97*, ë = *235*</bullet> <bullet>iso-8859-7: a = *97*, α = *225*, Ï = *249*</bullet> <bullet>Unicode: a = *97*, ë = *235*, Ï = *969*</bullet> </list> <break/> <blurb>Character Encoding Sequence</blurb> <list> <bullet>iso-8859-1: a = *0x61*, ë = *0xEB*</bullet> <bullet>UTF-8: a = *0x61*, ë = *0xC3* *0xAB*, Ï = *0xCF* *0x89*</bullet> <bullet>UTF-16: a = *0x00 0x61*, ë = *0x00* *0xEB*, Ï = *0x03* *0xC9*</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/encoding-overview.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/encoding-overview.xml +++ presentations/slides/i18nl10n/encoding-overview.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Encodings Overview</title> <image align="center" filename="encoding-overview.png"/> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/fallback-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/fallback-encoding.xml +++ presentations/slides/i18nl10n/fallback-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Fallback Encoding</title> <list> <bullet>Used if any of the other encoding settings is not set</bullet> <bullet>Easy way of configuring all encoding settings</bullet> <bullet>Defaults to UTF-8 if it's not set</bullet> </list> <blurb>INI Settings Recap:</blurb> <example><![CDATA[unicode.script_encoding = "UTF-8" Source encoding for your script unicode.runtime_encoding = "iso-8859-15" Internal encoding used for "native strings" unicode.from_error_subst_char = "2f" Hex value of substitution character unicode.http_input_encoding = "UTF-8" Default encoding for HTTP input variables unicode.output_encoding = "UTF-8" Encoding used for script output unicode.fallback_encoding = "UTF-8" Fallback encoding]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/filename-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/filename-encoding.xml +++ presentations/slides/i18nl10n/filename-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Filename Encoding</title> <list> <bullet></bullet> </list> <example><![CDATA[]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/goals-1.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/goals-1.xml +++ presentations/slides/i18nl10n/goals-1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>What Do We Want for PHP?</title> <list> <bullet>Native Unicode strings</bullet> <bullet>A clear separation between Binary, Native (Encoded) Strings and Unicode Strings</bullet> <bullet>Unicode string literals</bullet> <bullet>Updated language semantics</bullet> <bullet>Where possible, upgrade the existing functions</bullet> <bullet>Backwards compability</bullet> <bullet>PHP should do what most people will expect</bullet> <bullet>Make complex things possible, without making using strings in PHP complex</bullet> <bullet>Must be as good as Java's support</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/http-input-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/http-input-encoding.xml +++ presentations/slides/i18nl10n/http-input-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>HTTP Input Encoding</title> <list> <bullet>In Unicode mode, we need to make sure incoming HTTP variables are correctly converted to Unicode</bullet> <bullet>GET requests never come with encoding attached</bullet> <bullet>POST requests sometimes come with encoding attached, but it might be wrong</bullet> <bullet>If there is no encoding found, PHP can use the %http_input_encoding% setting</bullet> <bullet>Frequently the input variables are in the same encoding as the page where they where send from</bullet> <bullet>But sometimes not, so an application can ask to recode them</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/http-output-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/http-output-encoding.xml +++ presentations/slides/i18nl10n/http-output-encoding.xml <?xml version="1.0" encoding="iso-8859-1"?> <slide fontsize="6em"> <title>HTTP Output Encoding</title> <list> <bullet>Is used as encoding for the output of the script</bullet> <bullet>Script output is encoding on the fly</bullet> <bullet>Binary strings will never be automatically converted</bullet> </list> <blurb>On the fly encoding:</blurb> <example result="1"><![CDATA[<?php declare(encoding="iso-8859-1"); ini_set('unicode.output_encoding', 'utf-8'); $str = "rødbærsyltetøy<br/>"; $bstr = b"rødbærsyltetøy<br/>"; echo $str, $bstr; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/icu.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/icu.xml +++ presentations/slides/i18nl10n/icu.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How Will It Be Implemented?</title> <blurb>ICU: IBMs Components for Unicode</blurb> <list> <bullet>Unicode is extremely complex, with ICU we don't have to implement it ourselves</bullet> <bullet>ICU has a lot of features, is fast, stable, portable, extensible, Open Source and well maintained and supported</bullet> </list> <blurb>ICU Features</blurb> <list> <bullet>Character, String and Text processing</bullet> <bullet>Text Transformations</bullet> <bullet>Encoding Conversions</bullet> <bullet>Collation</bullet> <bullet>Localization: date, time, number, currency formatting</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-can-do-it-now.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-can-do-it-now.xml +++ presentations/slides/i18nl10n/php-can-do-it-now.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Do We Need Something New?</title> <list> <bullet>PHP only deals with bytes, not characters.</bullet> <bullet>PHP doesn't know anything about encodings.</bullet> <bullet>Having a binary image in a string is nice, but not if you need to deal with i18n</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-in-html.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-in-html.xml +++ presentations/slides/i18nl10n/php-in-html.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>PHP and HTML</title> <list> <bullet>PHP's strength is its embedding in HTML.</bullet> <bullet>These HTML blocks should be in the same encoding as the PHP script embedded in it.</bullet> <bullet>Embedded HTML will be converted to the output encoding.</bullet> </list> <break lines="2"/> <example result="1"><![CDATA[<?php $string = "â¿é»"; echo $string[0]; ?>æ<?php echo $string[1]; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-iconv.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-iconv.xml +++ presentations/slides/i18nl10n/php-now-iconv.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Iconv</title> <subtitle>Character Set Conversions</subtitle> <list> <bullet>Is part of glibc</bullet> <bullet>BSD requires an external library</bullet> <bullet>Enabled by default in PHP 5</bullet> <bullet>Supports 100s of character sets</bullet> </list> <div effect="hide"> <blurb>But it doesn't solve:</blurb> <blurb>|ff0000|localization, sorting, searching, encoding detection *and* you still work with binary data only!|</blurb> </div> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-locales.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-locales.xml +++ presentations/slides/i18nl10n/php-now-locales.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Anything Else That Sucks?</title> <subtitle>Locales in PHP</subtitle> <list> <bullet>Some of PHP's functions can make use of POSIX-locales</bullet> <bullet>But that's only a few of them</bullet> <bullet>Those locales are system dependent (different names, rules, etc...)</bullet> <bullet>They are not always available</bullet> </list> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/php-now-mbstring.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/php-now-mbstring.xml +++ presentations/slides/i18nl10n/php-now-mbstring.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>mbstring</title> <subtitle>Multi Byte Support!</subtitle> <list> <bullet>Handles certain encoding problems for you</bullet> <bullet>Updates string functions by "overloading" them</bullet> </list> <div effect="hide"> <blurb>But it doesn't solve:</blurb> <blurb>|ff0000|localization, sorting, searching *and* you still work with binary data only!|</blurb> </div> <!-- vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/properties.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/properties.xml +++ presentations/slides/i18nl10n/properties.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Unicode Is More</title> <list> <bullet>Unicode is a multi-linguage character set</bullet> <bullet>Standard encodings: UTF-8, UTF-16 and UTF-32</bullet> <bullet>Defines algorithms for plenty of issues (Collation, Bidi, Normalization)</bullet> <bullet>It defines properties for characters:</bullet> </list> <example><![CDATA[à 00C5;LATIN CAPITAL LETTER A WITH RING ABOVE;Lu;0;L;0041 030A;;;; N;LATIN CAPITAL LETTER A RING;;;00E5; Ç 01C4;LATIN CAPITAL LETTER DZ WITH CARON;Lu;0;L;<compat> 0044 017D;;;; N;LATIN CAPITAL LETTER D Z HACEK;;;01C6;01C5 â« 212B;ANGSTROM SIGN;Lu;0;L;00C5;;;; N;ANGSTROM UNIT;;;00E5; ]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/roadmap.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/roadmap.xml +++ presentations/slides/i18nl10n/roadmap.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Roadmap</title> <list type="number"> <bullet>|008800|Support Unicode in the Engine|</bullet> <bullet>|008800|Upgrade exist||FF8800|ing functions|</bullet> <bullet>|008800|Add new| |FF8800|functions for explicit i18n/l10n support|</bullet> <bullet>|FF3300|Expose ICU's features|</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/runtime-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/runtime-encoding.xml +++ presentations/slides/i18nl10n/runtime-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Runtime Encoding</title> <list> <bullet>Determines which encoding to attach to Native Strings</bullet> <bullet>Also used when functions are not upgraded to support Unicode yet</bullet> </list> <break/> <blurb>Encoding problems:</blurb> <example result="1"><![CDATA[<?php ini_set('unicode.runtime_encoding', 'iso-8859-5'); ini_set('unicode.from_error_subst_char', '2D'); $food = 'blÃ¥bær != блабаÑ'; $food2 = (string) $food; $food3 = (unicode) $food2; echo $food, '<br/>', $food2, '<br/>', $food3, "<br/>\n"; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/script-encoding-pragma.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/script-encoding-pragma.xml +++ presentations/slides/i18nl10n/script-encoding-pragma.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <subtitle>Setting Script Encoding With declare()</subtitle> <blurb>Interpreting an iso-8859-1 script as UTF-8:</blurb> <example result="1"><![CDATA[<?php declare(encoding="iso-8859-1"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> <break lines="3"/> <blurb>Interpreting an UTF-8 script as UTF-8:</blurb> <example result="1"><![CDATA[<?php declare(encoding="utf-8"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/script-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/script-encoding.xml +++ presentations/slides/i18nl10n/script-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <list> <bullet>Is used by the parser to read in your script</bullet> <bullet>Determines how string literals and identifiers are handled</bullet> <bullet>Can be set with an ini setting (script_encoding) or with an inline "pragma"</bullet> <bullet>No matter what the script's encoding is, the resulting string is always a Unicode string (or identifier)</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/sorting.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/sorting.xml +++ presentations/slides/i18nl10n/sorting.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Sorting Strings</title> <subtitle>The French Are Weird</subtitle> <blurb> How would you sort: *côté* (side), *côte* (coast), *cote* (dimension), *coté* (with dimensions)? </blurb> <break/> <blurb> Logical is: cote, cot*é*, c*ô*te, c*ô*t*é* </blurb> <div effect="hide"> <break/> <blurb> But the french do it like: cote, c*ô*te, cot*é*, c*ô*t*é* </blurb> <break lines="4"/> <blurb>The french are not the only ones with "weird" sorting!</blurb> <list> <bullet>In Lithuanian, *y* is sorted between *i* and *k*.</bullet> <bullet>In traditional Spanish *ch* is treated as a single letter, and sorted between *c* and *d*.</bullet> <bullet>In Swedish *v* and *w* are considered variant forms of the same letter.</bullet> <bullet>In German dictionaries, *öf* would come before *of*. In phone books the situation is the exact opposite.</bullet> </list> </div> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/stream-encoding.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/stream-encoding.xml +++ presentations/slides/i18nl10n/stream-encoding.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Stream Encoding</title> <list> <bullet></bullet> </list> <example><![CDATA[]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-binary.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-binary.xml +++ presentations/slides/i18nl10n/string-binary.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>B1nary String Literals</title> <subtitle>string -> binary</subtitle> <list> <bullet>Binary string literals are explicit</bullet> <bullet>The actual variable's contents depend on the script encoding</bullet> </list> <example result="1"><![CDATA[<?php // script is encoded in UTF-8 function varc($s) { for ($i = 0; $i < strlen($s); ++$i) echo sprintf("%02X ", ord($s[$i])); echo "<br/>\n"; } $s1 = b'weed'; $s2 = b"qua\x72k"; $s3 = b<<<EOBS gold = é EOBS; echo varc($s1), varc($s2), varc($s3), "\n"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-escape.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-escape.xml +++ presentations/slides/i18nl10n/string-escape.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Literal Escapes</title> <blurb>When Unicode semantics are enabled, you can use the \uXXXX and \UXXXXXX escape sequences to specific Unicode code points</blurb> <break lines="2"/> <example result="1"><![CDATA[ <?php // script is encoded in UTF-8 $str = "é is equivalent with \u91d1<br/>\n"; echo $str, "<br/>\n"; echo "ð is equivalent with:<br/>\n"; echo "- \U010083<br/>\n"; echo "- \C{LINEAR B IDEOGRAM B105 EQUID}"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-literals.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-literals.xml +++ presentations/slides/i18nl10n/string-literals.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Literals</title> <subtitle>string -> string, unicode</subtitle> <blurb>Unicode Semantics are *off*:</blurb> <example><![CDATA[<?php // script is encoded in UTF-8 $str = "hallo daar!"; echo gettype($str), ': ', strlen($str), "\n"; $str = "пÑивеÑ!"; echo gettype($str), ': ', strlen($str), "\n"; ?>]]></example> <blurb>outputs:</blurb> <example>string: 11 string: 13</example> <break/> <blurb>Unicode Semantics are *on*:</blurb> <example><![CDATA[<?php // script is encoded in UTF-8 $str = "hallo daar!"; echo gettype($str), ': ', strlen($str), "\n"; $str = "пÑивеÑ!"; echo gettype($str), ': ', strlen($str), "\n"; ?>]]></example> <blurb>outputs:</blurb> <example>unicode: 11 unicode: 7</example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/string-types.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/string-types.xml +++ presentations/slides/i18nl10n/string-types.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>String Types</title> <list> <bullet>*binary*: Used to represent binary data, for example the contents of a JPEG file.</bullet> </list> <example>. P N G . . . . . . . . I H D R 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52</example> <break/> <list> <bullet>*string*: Native string, encoded with the current script's encoding. For backwards compatibility.</bullet> </list> <example>B l Ã¥ b æ r ø l 62 6C C3 A5 62 C3 A6 72 C3 A8 6C</example> <break/> <list> <bullet>*unicode*: Strings, internally encoded in UTF-16.</bullet> </list> <example>B l Ã¥ b æ r ø l 62 00 6C 00 E5 00 62 00 E6 00 72 00 F8 00 6C 00</example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/surrogates.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/surrogates.xml +++ presentations/slides/i18nl10n/surrogates.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>UTF 16 Surrogates</title> <blurb> As UTF-16 is supposed to encode the full Unicode character set. </blurb> <list> <bullet>UTF-16 uses a double two-byte sequence for characters outside the BMP</bullet> <bullet>Special ranges in the Unicode range are used for this</bullet> </list> <example><![CDATA[byte 1 = 1101 10yy yyyy yyyy byte 2 = 1101 11xx xxxx xxxx MUSICAL SYMBOL SIXTEENTH NOTE (0x1d161) 1101 10yy yyyy yyyy 1101 11xx xxxx xxxx ---- --++ +111 0100 ---- --01 0110 0001 ======================================== 1101 1000 0111 0100 1101 1101 0110 0001 0xd8 0x74 0xdd 0x61]]></example> <list> <bullet>Code *point*: a character</bullet> <bullet>Code *unit*: a two-byte sequence with UTF-16</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/unicode-semantics.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/unicode-semantics.xml +++ presentations/slides/i18nl10n/unicode-semantics.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>How Do We Turn It On?</title> <list> <bullet>With an INI setting: %unicode_semantics%</bullet> <bullet>It can be turned on "per-request"</bullet> <bullet>(Almost) no behavioral changes when it's not enabled</bullet> <bullet>The setting does not mean you won't have any Unicode strings</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/upgrading-functions.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/upgrading-functions.xml +++ presentations/slides/i18nl10n/upgrading-functions.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Upgrading Functions</title> <list> <bullet></bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/i18nl10n/what-languages.xml?r=1.1&p=1 Index: presentations/slides/i18nl10n/what-languages.xml +++ presentations/slides/i18nl10n/what-languages.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>What is this about anyway?</title> <list> <bullet>There is more than one country in the world</bullet> <bullet>Ce n'est pas tout le monde qui parle anglais</bullet> <bullet>Tjueseks karakterer holder ikke mÃ¥l</bullet> <bullet>ÐÐ¾Ñ ÑвÑибади из Ñзин Ð·Ñ ÑÑйм ÑкÑÐ¸Ð¿Ñ Ð¸Ð²Ñн</bullet> <bullet>It gets even more complicated with Chinese languages</bullet> </list> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables1.xml?r=1.1&p=1 Index: presentations/slides/internals/variables1.xml +++ presentations/slides/internals/variables1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>The Symbol Table</subtitle> <image align="center" filename="figure1.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables10.xml?r=1.1&p=1 Index: presentations/slides/internals/variables10.xml +++ presentations/slides/internals/variables10.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Bad Return by Reference</subtitle> <image align="center" filename="figure10.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables2.xml?r=1.1&p=1 Index: presentations/slides/internals/variables2.xml +++ presentations/slides/internals/variables2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Introducing Refcounting</subtitle> <image align="center" filename="figure2.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables3.xml?r=1.1&p=1 Index: presentations/slides/internals/variables3.xml +++ presentations/slides/internals/variables3.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Refcounting and Passing Variables to Functions</subtitle> <image align="center" filename="figure3.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables4.xml?r=1.1&p=1 Index: presentations/slides/internals/variables4.xml +++ presentations/slides/internals/variables4.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Introducing References</subtitle> <image align="center" filename="figure4.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables5.xml?r=1.1&p=1 Index: presentations/slides/internals/variables5.xml +++ presentations/slides/internals/variables5.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Mixing Assign-By Value and Assign-by Reference</subtitle> <image align="center" filename="figure5.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables6.xml?r=1.1&p=1 Index: presentations/slides/internals/variables6.xml +++ presentations/slides/internals/variables6.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Mixing Assign-by Reference and Assign-by Value</subtitle> <image align="center" filename="figure6.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables7.xml?r=1.1&p=1 Index: presentations/slides/internals/variables7.xml +++ presentations/slides/internals/variables7.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Passing by Reference</subtitle> <image align="center" filename="figure7.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables8.xml?r=1.1&p=1 Index: presentations/slides/internals/variables8.xml +++ presentations/slides/internals/variables8.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>Return by Reference</subtitle> <image align="center" filename="figure8.png" /> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/co.php/presentations/slides/internals/variables9.xml?r=1.1&p=1 Index: presentations/slides/internals/variables9.xml +++ presentations/slides/internals/variables9.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Variables</title> <subtitle>The "global" Keyword</subtitle> <image align="center" filename="figure9.png" /> <!-- # vim: encoding=utf8 --> </slide>