cvs: presentations /slides/i18nl10n characters-not-bytes.xml http-output-encoding.xml iterator-example.xml locale-example-arrays.xml
locale-example.xml locale-example2.xml roadmap.xml runtime-encoding.xml script-encoding-fun.xml script-encoding-fun1.xml script-encoding-fun2.xml
script-encoding-pragma.xml stream-encoding1.xml stream-encoding2.xml stream-encoding3.xml translit1.xml translit2.xml unicode-semantics.xml
unicode.xml when.xml
| From: | Derick Rethans | Date: | Fri, 03 Nov 2006 14:51:55 +0000 |
| Subject: | cvs: presentations /slides/i18nl10n characters-not-bytes.xml http-output-encoding.xml iterator-example.xml locale-example-arrays.xml locale-example.xml locale-example2.xml roadmap.xml runtime-encoding.xml script-encoding-fun.xml script-encoding-fun1.xml script-encoding-fun2.xml script-encoding-pragma.xml stream-encoding1.xml stream-encoding2.xml stream-encoding3.xml translit1.xml translit2.xml unicode-semantics.xml unicode.xml when.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1356@lists.php.net to get a copy of this message | ||
derick Fri Nov 3 14:51:55 2006 UTC
Added files:
/presentations/slides/i18nl10n script-encoding-fun.xml
script-encoding-fun1.xml
script-encoding-fun2.xml
stream-encoding1.xml
stream-encoding2.xml
stream-encoding3.xml translit1.xml
translit2.xml
Modified files:
/presentations/slides/i18nl10n characters-not-bytes.xml
http-output-encoding.xml
iterator-example.xml
locale-example-arrays.xml
locale-example.xml
locale-example2.xml roadmap.xml
runtime-encoding.xml
script-encoding-pragma.xml
unicode-semantics.xml unicode.xml
when.xml
Log:
- Unicode talk for frankfurt, updated slides.
http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/characters-not-bytes.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/characters-not-bytes.xml diff -u presentations/slides/i18nl10n/characters-not-bytes.xml:1.3 presentations/slides/i18nl10n/characters-not-bytes.xml:1.4 --- presentations/slides/i18nl10n/characters-not-bytes.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/characters-not-bytes.xml Fri Nov 3 14:51:55 2006 @@ -9,14 +9,12 @@ </list> <blurb>String Indexes:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $string = "ç½é¡µæç´¢"; // bytes are: E7 BD 91 E9 A1 B5 E6 90 9C E7 B4 A2 echo $string[1]; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">页</blurb> <!-- # vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/http-output-encoding.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/http-output-encoding.xml diff -u presentations/slides/i18nl10n/http-output-encoding.xml:1.2 presentations/slides/i18nl10n/http-output-encoding.xml:1.3 --- presentations/slides/i18nl10n/http-output-encoding.xml:1.2 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/http-output-encoding.xml Fri Nov 3 14:51:55 2006 @@ -14,7 +14,7 @@ ini_set('unicode.output_encoding', 'utf-8'); $str = "rødbærsyltetøy<br/>"; - $bstr = b"rødbærsyltetøy<br/>"; + $bstr = b "rødbærsyltetøy<br/>"; echo $str, $bstr; ?>]]></example> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/iterator-example.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/i18nl10n/iterator-example.xml diff -u presentations/slides/i18nl10n/iterator-example.xml:1.1 presentations/slides/i18nl10n/iterator-example.xml:1.2 --- presentations/slides/i18nl10n/iterator-example.xml:1.1 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/iterator-example.xml Fri Nov 3 14:51:55 2006 @@ -3,22 +3,11 @@ <title>Text Iteration</title> <subtitle>Example</subtitle> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $text = "Pouvez-vous me dire quelle heure il est ? Merci."; foreach (new TextIterator($text, TextIterator::LINE) as $u) { if ($u != " ") echo($u),"<br/>\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[ -Pouvez-<br/> -vous <br/> -me <br/> -dire <br/> -quelle <br/> -heure <br/> -il <br/> -est ? <br/> -Merci.<br/>]]></blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example-arrays.xml?r1=1.4&r2=1.5&diff_format=u Index: presentations/slides/i18nl10n/locale-example-arrays.xml diff -u presentations/slides/i18nl10n/locale-example-arrays.xml:1.4 presentations/slides/i18nl10n/locale-example-arrays.xml:1.5 --- presentations/slides/i18nl10n/locale-example-arrays.xml:1.4 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example-arrays.xml Fri Nov 3 14:51:55 2006 @@ -3,7 +3,7 @@ <title>ICU Locales</title> <subtitle>Array Sorting Example</subtitle> - <example><![CDATA[<pre># orig norm loc trad + <example result='1'><![CDATA[<pre># orig norm loc trad -------------------------- <?php $d = $c = $b = $a = array('mapa', 'kilo', 'libro', 'llave', 'loca'); @@ -18,10 +18,6 @@ $i + 1, $a[$i], $b[$i], $c[$i], $d[$i]); } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[<pre># orig norm loc trad --------------------------- -1. mapa kilo kilo kilo <br/>2. kilo libro libro libro<br/>3. libro llave llave loca <br/>4. llave loca loca llave<br/>5. loca mapa mapa mapa <br/>]]></blurb> <!-- # vim: encoding=utf8 http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example.xml?r1=1.5&r2=1.6&diff_format=u Index: presentations/slides/i18nl10n/locale-example.xml diff -u presentations/slides/i18nl10n/locale-example.xml:1.5 presentations/slides/i18nl10n/locale-example.xml:1.6 --- presentations/slides/i18nl10n/locale-example.xml:1.5 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example.xml Fri Nov 3 14:51:55 2006 @@ -3,16 +3,12 @@ <title>ICU Locales</title> <subtitle>Example</subtitle> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php locale_set_default("nl"); echo strtotitle("het ijsselmeer (ijsselmeer) is Ãaf"), "<br/>\n"; locale_set_default("tr"); echo strtotitle("het ijsselmeer (ijsselmeer) is Ãaf"), "\n"; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">Het Ijsselmeer (IJsselmeer) Is Ssaf<br/> - Het İjsselmeer (IJsselmeer) İs Ssaf - </blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example2.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/locale-example2.xml diff -u presentations/slides/i18nl10n/locale-example2.xml:1.2 presentations/slides/i18nl10n/locale-example2.xml:1.3 --- presentations/slides/i18nl10n/locale-example2.xml:1.2 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example2.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <subtitle>Example</subtitle> <blurb>Comparing strings:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $coll = new Collator("fr_CA"); if ($coll->compare("côte", "coté") < 0) { echo "less\n"; @@ -12,11 +12,9 @@ echo "greater\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">less</blurb> <break/> <blurb>Ignore case and accents:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $coll = new Collator("fr_CA"); $coll->setStrength(Collator::PRIMARY); if ($coll->compare("côte", "cOTé") == 0) { @@ -25,6 +23,4 @@ echo "different\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">same</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/roadmap.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/i18nl10n/roadmap.xml diff -u presentations/slides/i18nl10n/roadmap.xml:1.1 presentations/slides/i18nl10n/roadmap.xml:1.2 --- presentations/slides/i18nl10n/roadmap.xml:1.1 Fri Sep 9 15:04:35 2005 +++ presentations/slides/i18nl10n/roadmap.xml Fri Nov 3 14:51:55 2006 @@ -3,9 +3,11 @@ <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> + <bullet>Support Unicode in the Engine</bullet> + <bullet>Upgrade existing functions: 40% done</bullet> + <bullet>Add new functions for explicit i18n/l10n support</bullet> + <bullet>Expose ICU's features</bullet> </list> + + <blurb>http://php.net/ ~scoates/unicode/render_func_data.php</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/runtime-encoding.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/runtime-encoding.xml diff -u presentations/slides/i18nl10n/runtime-encoding.xml:1.3 presentations/slides/i18nl10n/runtime-encoding.xml:1.4 --- presentations/slides/i18nl10n/runtime-encoding.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/runtime-encoding.xml Fri Nov 3 14:51:55 2006 @@ -8,7 +8,7 @@ </list> <break/> <blurb>Encoding problems:</blurb> - <example><![CDATA[<?php + <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 != блабаÑ'; @@ -16,6 +16,4 @@ $food3 = (string) $food2; echo $food, '<br/>', $food2, '<br/>', $food3, "<br/>\n"; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[blÃ¥bær != блабаÑ<br/>bl?b?r != ������<br/>bl?b?r != блабаÑ<br/>]]></blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-pragma.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/script-encoding-pragma.xml diff -u presentations/slides/i18nl10n/script-encoding-pragma.xml:1.3 presentations/slides/i18nl10n/script-encoding-pragma.xml:1.4 --- presentations/slides/i18nl10n/script-encoding-pragma.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/script-encoding-pragma.xml Fri Nov 3 14:51:55 2006 @@ -4,23 +4,19 @@ <subtitle>Setting Script Encoding With declare()</subtitle> <blurb>Interpreting an iso-8859-1 script as UTF-8:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php declare(encoding="iso-8859-1"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">unicode(10) "blÃÂ¥ = éÂÂ" { 0062 006c 00c3 00a5 0020 003d 0020 00e9 009d 0092 }</blurb> <break lines="3"/> <blurb>Interpreting an UTF-8 script as UTF-8:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php declare(encoding="utf-8"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">unicode(7) "blÃ¥ = é" { 0062 006c 00e5 0020 003d 0020 9752 }</blurb> <!-- # vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/unicode-semantics.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/unicode-semantics.xml diff -u presentations/slides/i18nl10n/unicode-semantics.xml:1.2 presentations/slides/i18nl10n/unicode-semantics.xml:1.3 --- presentations/slides/i18nl10n/unicode-semantics.xml:1.2 Thu Mar 30 17:07:16 2006 +++ presentations/slides/i18nl10n/unicode-semantics.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <list> <bullet>With an INI setting: %unicode_semantics%</bullet> - <bullet>It can be turned on "per-vhost"</bullet> + <bullet>It can be turned on "per-vhost" (maybe *not*)</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> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/unicode.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/unicode.xml diff -u presentations/slides/i18nl10n/unicode.xml:1.2 presentations/slides/i18nl10n/unicode.xml:1.3 --- presentations/slides/i18nl10n/unicode.xml:1.2 Wed Feb 23 16:04:01 2005 +++ presentations/slides/i18nl10n/unicode.xml Fri Nov 3 14:51:55 2006 @@ -5,8 +5,8 @@ <list> <bullet>UCS uses 31 bits for character storage</bullet> <bullet>Contains all known characters and symbols</bullet> - <bullet>First 128 bytes are the same as ASCII</bullet> - <bullet>First 256 bytes are the same as ISO-8859-1</bullet> + <bullet>First 128 characters are the same as ASCII</bullet> + <bullet>First 256 characters are the same as ISO-8859-1</bullet> <bullet>Unicode 3.0 describes the BMP ~(Basic Multilingual Plane)~ (16 bits)</bullet> <bullet>Unicode 3.1 describes other planes (21 bits)</bullet> <bullet>Characters are ordered in language/script blocks: Basic latin, Cyrillic, Hebrew, Arabic, Gujarati, Runic, CJK etc.</bullet> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/when.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/when.xml diff -u presentations/slides/i18nl10n/when.xml:1.3 presentations/slides/i18nl10n/when.xml:1.4 --- presentations/slides/i18nl10n/when.xml:1.3 Thu Mar 30 17:07:16 2006 +++ presentations/slides/i18nl10n/when.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <list> <bullet>When it is ready.</bullet> - <bullet>Development version is in CVS.</bullet> - <bullet>Release: hopefully at the end of 2006.</bullet> + <bullet>Development version is in CVS, get snapshots.</bullet> + <bullet>Release: preview release at the end of 2006.</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun.xml +++ presentations/slides/i18nl10n/script-encoding-fun.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class Person { public $firstName; public $lastName; public $birthday; function calculateAge() { $age = (time() - $this->birthday) / (365.2422 * 86400); return floor($age); } } $me = new Person; $me->birthday = strtotime( "1978-12-22 09:15" ); echo "I am " . $me->calculateAge() . " years old."; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun1.xml +++ presentations/slides/i18nl10n/script-encoding-fun1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class Person { public $firstName; public $lastName; public $birthday; function calculateAge() { $age = (time() - $this->birthday) / (365.2422 * 86400); return floor($age); } } $me = new Person; $me->birthday = strtotime( "1978-12-22 09:15" ); echo "I am " . $me->calculateAge() . " years old."; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun2.xml +++ presentations/slides/i18nl10n/script-encoding-fun2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class 人 { public $å; public $å§; public $èªçæ¥; function å¹´é½¢ãè¨ç®() { $å¹´é½¢ = (time() - $this->èªçæ¥) / (365.2422 * 86400); return floor($å¹´é½¢); } } $ç§ = new 人; $ç§->èªçæ¥ = strtotime( "1978-12-22 09:15" ); echo "ç§ã¯ " . $ç§->å¹´é½¢ãè¨ç®() . " æã§ãã"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding1.xml +++ presentations/slides/i18nl10n/stream-encoding1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Streams I/O</title> <list> <bullet>PHP's IO uses a unified layer: streams</bullet> <bullet>There is no clue in many cases what encoding a file is in</bullet> <bullet>By default, PHP opens streams in binary mode, and no encoding conversion is done</bullet> </list> </slide> <!-- vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding2.xml +++ presentations/slides/i18nl10n/stream-encoding2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Text Streams</title> <blurb>%t% is no longer only for Windows line endings.</blurb> <break/> <blurb>Default encoding is used, which is by default UTF-8. The following reads 42 UTF-8 characters and returns them as a Unicode string:</blurb> <example><![CDATA[<?php $f = fopen( "somefile.txt", "rt" ); $str = fread( $f, 42 ); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding3.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding3.xml +++ presentations/slides/i18nl10n/stream-encoding3.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Text Streams</title> <subtitle>Default context</subtitle> <blurb>You can change the default encoding like:</blurb> <example><![CDATA[<?php stream_default_encoding( "iso-8859-1" ); $str = file_get_contents( "somefile.txt", FILE_TEXT ); ?>]]></example> <break/> <blurb>Or use a specific context for a stream:</blurb> <example><![CDATA[<?php $ctxt = stream_context_create( NULL, array( 'encoding' => 'koi8-r' ) ); file_put_contents( "someotherfile.txt", $data, FILE_TEXT, $ctxt ); ?>]]></example> <break/> <blurb>Or set the encoding after opening a stream:</blurb> <example><![CDATA[<?php $f = fopen( "someotherfile.txt", 'r' ); stream_encoding( $f, 'iso-8859-5' ); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/translit1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/translit1.xml +++ presentations/slides/i18nl10n/translit1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Transliteration</title> <example result='1'><![CDATA[<?php $names = "ã§ãã£ã ããªã㯠ÐеÑик РеÑÑ Ð°Ð½Ñ"; echo nl2br( strtotitle( str_transliterate( $names, 'Any', 'Latin' ) ) ); ?>]]></example> <break lines="3"/> <example result='1'><![CDATA[<?php $t = str_transliterate( 'Derick Rethans', 'Latin', 'Katakana' ); $b = str_transliterate( $t, 'Katakana', 'Latin' ); echo $t, ' ', $b; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/translit2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/translit2.xml +++ presentations/slides/i18nl10n/translit2.xml
http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/characters-not-bytes.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/characters-not-bytes.xml diff -u presentations/slides/i18nl10n/characters-not-bytes.xml:1.3 presentations/slides/i18nl10n/characters-not-bytes.xml:1.4 --- presentations/slides/i18nl10n/characters-not-bytes.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/characters-not-bytes.xml Fri Nov 3 14:51:55 2006 @@ -9,14 +9,12 @@ </list> <blurb>String Indexes:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $string = "ç½é¡µæç´¢"; // bytes are: E7 BD 91 E9 A1 B5 E6 90 9C E7 B4 A2 echo $string[1]; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">页</blurb> <!-- # vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/http-output-encoding.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/http-output-encoding.xml diff -u presentations/slides/i18nl10n/http-output-encoding.xml:1.2 presentations/slides/i18nl10n/http-output-encoding.xml:1.3 --- presentations/slides/i18nl10n/http-output-encoding.xml:1.2 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/http-output-encoding.xml Fri Nov 3 14:51:55 2006 @@ -14,7 +14,7 @@ ini_set('unicode.output_encoding', 'utf-8'); $str = "rødbærsyltetøy<br/>"; - $bstr = b"rødbærsyltetøy<br/>"; + $bstr = b "rødbærsyltetøy<br/>"; echo $str, $bstr; ?>]]></example> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/iterator-example.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/i18nl10n/iterator-example.xml diff -u presentations/slides/i18nl10n/iterator-example.xml:1.1 presentations/slides/i18nl10n/iterator-example.xml:1.2 --- presentations/slides/i18nl10n/iterator-example.xml:1.1 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/iterator-example.xml Fri Nov 3 14:51:55 2006 @@ -3,22 +3,11 @@ <title>Text Iteration</title> <subtitle>Example</subtitle> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $text = "Pouvez-vous me dire quelle heure il est ? Merci."; foreach (new TextIterator($text, TextIterator::LINE) as $u) { if ($u != " ") echo($u),"<br/>\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[ -Pouvez-<br/> -vous <br/> -me <br/> -dire <br/> -quelle <br/> -heure <br/> -il <br/> -est ? <br/> -Merci.<br/>]]></blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example-arrays.xml?r1=1.4&r2=1.5&diff_format=u Index: presentations/slides/i18nl10n/locale-example-arrays.xml diff -u presentations/slides/i18nl10n/locale-example-arrays.xml:1.4 presentations/slides/i18nl10n/locale-example-arrays.xml:1.5 --- presentations/slides/i18nl10n/locale-example-arrays.xml:1.4 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example-arrays.xml Fri Nov 3 14:51:55 2006 @@ -3,7 +3,7 @@ <title>ICU Locales</title> <subtitle>Array Sorting Example</subtitle> - <example><![CDATA[<pre># orig norm loc trad + <example result='1'><![CDATA[<pre># orig norm loc trad -------------------------- <?php $d = $c = $b = $a = array('mapa', 'kilo', 'libro', 'llave', 'loca'); @@ -18,10 +18,6 @@ $i + 1, $a[$i], $b[$i], $c[$i], $d[$i]); } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[<pre># orig norm loc trad --------------------------- -1. mapa kilo kilo kilo <br/>2. kilo libro libro libro<br/>3. libro llave llave loca <br/>4. llave loca loca llave<br/>5. loca mapa mapa mapa <br/>]]></blurb> <!-- # vim: encoding=utf8 http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example.xml?r1=1.5&r2=1.6&diff_format=u Index: presentations/slides/i18nl10n/locale-example.xml diff -u presentations/slides/i18nl10n/locale-example.xml:1.5 presentations/slides/i18nl10n/locale-example.xml:1.6 --- presentations/slides/i18nl10n/locale-example.xml:1.5 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example.xml Fri Nov 3 14:51:55 2006 @@ -3,16 +3,12 @@ <title>ICU Locales</title> <subtitle>Example</subtitle> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php locale_set_default("nl"); echo strtotitle("het ijsselmeer (ijsselmeer) is Ãaf"), "<br/>\n"; locale_set_default("tr"); echo strtotitle("het ijsselmeer (ijsselmeer) is Ãaf"), "\n"; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">Het Ijsselmeer (IJsselmeer) Is Ssaf<br/> - Het İjsselmeer (IJsselmeer) İs Ssaf - </blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/locale-example2.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/locale-example2.xml diff -u presentations/slides/i18nl10n/locale-example2.xml:1.2 presentations/slides/i18nl10n/locale-example2.xml:1.3 --- presentations/slides/i18nl10n/locale-example2.xml:1.2 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/locale-example2.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <subtitle>Example</subtitle> <blurb>Comparing strings:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $coll = new Collator("fr_CA"); if ($coll->compare("côte", "coté") < 0) { echo "less\n"; @@ -12,11 +12,9 @@ echo "greater\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">less</blurb> <break/> <blurb>Ignore case and accents:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php $coll = new Collator("fr_CA"); $coll->setStrength(Collator::PRIMARY); if ($coll->compare("côte", "cOTé") == 0) { @@ -25,6 +23,4 @@ echo "different\n"; } ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">same</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/roadmap.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/i18nl10n/roadmap.xml diff -u presentations/slides/i18nl10n/roadmap.xml:1.1 presentations/slides/i18nl10n/roadmap.xml:1.2 --- presentations/slides/i18nl10n/roadmap.xml:1.1 Fri Sep 9 15:04:35 2005 +++ presentations/slides/i18nl10n/roadmap.xml Fri Nov 3 14:51:55 2006 @@ -3,9 +3,11 @@ <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> + <bullet>Support Unicode in the Engine</bullet> + <bullet>Upgrade existing functions: 40% done</bullet> + <bullet>Add new functions for explicit i18n/l10n support</bullet> + <bullet>Expose ICU's features</bullet> </list> + + <blurb>http://php.net/ ~scoates/unicode/render_func_data.php</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/runtime-encoding.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/runtime-encoding.xml diff -u presentations/slides/i18nl10n/runtime-encoding.xml:1.3 presentations/slides/i18nl10n/runtime-encoding.xml:1.4 --- presentations/slides/i18nl10n/runtime-encoding.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/runtime-encoding.xml Fri Nov 3 14:51:55 2006 @@ -8,7 +8,7 @@ </list> <break/> <blurb>Encoding problems:</blurb> - <example><![CDATA[<?php + <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 != блабаÑ'; @@ -16,6 +16,4 @@ $food3 = (string) $food2; echo $food, '<br/>', $food2, '<br/>', $food3, "<br/>\n"; ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output"><![CDATA[blÃ¥bær != блабаÑ<br/>bl?b?r != ������<br/>bl?b?r != блабаÑ<br/>]]></blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-pragma.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/script-encoding-pragma.xml diff -u presentations/slides/i18nl10n/script-encoding-pragma.xml:1.3 presentations/slides/i18nl10n/script-encoding-pragma.xml:1.4 --- presentations/slides/i18nl10n/script-encoding-pragma.xml:1.3 Wed Jun 28 12:20:40 2006 +++ presentations/slides/i18nl10n/script-encoding-pragma.xml Fri Nov 3 14:51:55 2006 @@ -4,23 +4,19 @@ <subtitle>Setting Script Encoding With declare()</subtitle> <blurb>Interpreting an iso-8859-1 script as UTF-8:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php declare(encoding="iso-8859-1"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">unicode(10) "blÃÂ¥ = éÂÂ" { 0062 006c 00c3 00a5 0020 003d 0020 00e9 009d 0092 }</blurb> <break lines="3"/> <blurb>Interpreting an UTF-8 script as UTF-8:</blurb> - <example><![CDATA[<?php + <example result='1'><![CDATA[<?php declare(encoding="utf-8"); $str = "blÃ¥ = é"; var_inspect($str); ?>]]></example> - <blurb>Output:</blurb> - <blurb class="bit_larger_output">unicode(7) "blÃ¥ = é" { 0062 006c 00e5 0020 003d 0020 9752 }</blurb> <!-- # vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/unicode-semantics.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/unicode-semantics.xml diff -u presentations/slides/i18nl10n/unicode-semantics.xml:1.2 presentations/slides/i18nl10n/unicode-semantics.xml:1.3 --- presentations/slides/i18nl10n/unicode-semantics.xml:1.2 Thu Mar 30 17:07:16 2006 +++ presentations/slides/i18nl10n/unicode-semantics.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <list> <bullet>With an INI setting: %unicode_semantics%</bullet> - <bullet>It can be turned on "per-vhost"</bullet> + <bullet>It can be turned on "per-vhost" (maybe *not*)</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> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/unicode.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/i18nl10n/unicode.xml diff -u presentations/slides/i18nl10n/unicode.xml:1.2 presentations/slides/i18nl10n/unicode.xml:1.3 --- presentations/slides/i18nl10n/unicode.xml:1.2 Wed Feb 23 16:04:01 2005 +++ presentations/slides/i18nl10n/unicode.xml Fri Nov 3 14:51:55 2006 @@ -5,8 +5,8 @@ <list> <bullet>UCS uses 31 bits for character storage</bullet> <bullet>Contains all known characters and symbols</bullet> - <bullet>First 128 bytes are the same as ASCII</bullet> - <bullet>First 256 bytes are the same as ISO-8859-1</bullet> + <bullet>First 128 characters are the same as ASCII</bullet> + <bullet>First 256 characters are the same as ISO-8859-1</bullet> <bullet>Unicode 3.0 describes the BMP ~(Basic Multilingual Plane)~ (16 bits)</bullet> <bullet>Unicode 3.1 describes other planes (21 bits)</bullet> <bullet>Characters are ordered in language/script blocks: Basic latin, Cyrillic, Hebrew, Arabic, Gujarati, Runic, CJK etc.</bullet> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/when.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/i18nl10n/when.xml diff -u presentations/slides/i18nl10n/when.xml:1.3 presentations/slides/i18nl10n/when.xml:1.4 --- presentations/slides/i18nl10n/when.xml:1.3 Thu Mar 30 17:07:16 2006 +++ presentations/slides/i18nl10n/when.xml Fri Nov 3 14:51:55 2006 @@ -4,7 +4,7 @@ <list> <bullet>When it is ready.</bullet> - <bullet>Development version is in CVS.</bullet> - <bullet>Release: hopefully at the end of 2006.</bullet> + <bullet>Development version is in CVS, get snapshots.</bullet> + <bullet>Release: preview release at the end of 2006.</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun.xml +++ presentations/slides/i18nl10n/script-encoding-fun.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class Person { public $firstName; public $lastName; public $birthday; function calculateAge() { $age = (time() - $this->birthday) / (365.2422 * 86400); return floor($age); } } $me = new Person; $me->birthday = strtotime( "1978-12-22 09:15" ); echo "I am " . $me->calculateAge() . " years old."; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun1.xml +++ presentations/slides/i18nl10n/script-encoding-fun1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class Person { public $firstName; public $lastName; public $birthday; function calculateAge() { $age = (time() - $this->birthday) / (365.2422 * 86400); return floor($age); } } $me = new Person; $me->birthday = strtotime( "1978-12-22 09:15" ); echo "I am " . $me->calculateAge() . " years old."; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/script-encoding-fun2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/script-encoding-fun2.xml +++ presentations/slides/i18nl10n/script-encoding-fun2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Script Encoding</title> <example result='1'><![CDATA[<?php class 人 { public $å; public $å§; public $èªçæ¥; function å¹´é½¢ãè¨ç®() { $å¹´é½¢ = (time() - $this->èªçæ¥) / (365.2422 * 86400); return floor($å¹´é½¢); } } $ç§ = new 人; $ç§->èªçæ¥ = strtotime( "1978-12-22 09:15" ); echo "ç§ã¯ " . $ç§->å¹´é½¢ãè¨ç®() . " æã§ãã"; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding1.xml +++ presentations/slides/i18nl10n/stream-encoding1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Streams I/O</title> <list> <bullet>PHP's IO uses a unified layer: streams</bullet> <bullet>There is no clue in many cases what encoding a file is in</bullet> <bullet>By default, PHP opens streams in binary mode, and no encoding conversion is done</bullet> </list> </slide> <!-- vim: encoding=utf8 --> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding2.xml +++ presentations/slides/i18nl10n/stream-encoding2.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Text Streams</title> <blurb>%t% is no longer only for Windows line endings.</blurb> <break/> <blurb>Default encoding is used, which is by default UTF-8. The following reads 42 UTF-8 characters and returns them as a Unicode string:</blurb> <example><![CDATA[<?php $f = fopen( "somefile.txt", "rt" ); $str = fread( $f, 42 ); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/stream-encoding3.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/stream-encoding3.xml +++ presentations/slides/i18nl10n/stream-encoding3.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Text Streams</title> <subtitle>Default context</subtitle> <blurb>You can change the default encoding like:</blurb> <example><![CDATA[<?php stream_default_encoding( "iso-8859-1" ); $str = file_get_contents( "somefile.txt", FILE_TEXT ); ?>]]></example> <break/> <blurb>Or use a specific context for a stream:</blurb> <example><![CDATA[<?php $ctxt = stream_context_create( NULL, array( 'encoding' => 'koi8-r' ) ); file_put_contents( "someotherfile.txt", $data, FILE_TEXT, $ctxt ); ?>]]></example> <break/> <blurb>Or set the encoding after opening a stream:</blurb> <example><![CDATA[<?php $f = fopen( "someotherfile.txt", 'r' ); stream_encoding( $f, 'iso-8859-5' ); ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/translit1.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/translit1.xml +++ presentations/slides/i18nl10n/translit1.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Transliteration</title> <example result='1'><![CDATA[<?php $names = "ã§ãã£ã ããªã㯠ÐеÑик РеÑÑ Ð°Ð½Ñ"; echo nl2br( strtotitle( str_transliterate( $names, 'Any', 'Latin' ) ) ); ?>]]></example> <break lines="3"/> <example result='1'><![CDATA[<?php $t = str_transliterate( 'Derick Rethans', 'Latin', 'Katakana' ); $b = str_transliterate( $t, 'Katakana', 'Latin' ); echo $t, ' ', $b; ?>]]></example> <!-- # vim: encoding=utf8 --> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/i18nl10n/translit2.xml?view=markup&rev=1.1 Index: presentations/slides/i18nl10n/translit2.xml +++ presentations/slides/i18nl10n/translit2.xml