2 header('content-type: text/html; charset=utf-8');
4 # Require the main "loader" script...
5 require_once '../../utf8.php';
7 # UTF8 constant can now be used for directory
8 # Follow functions automatically available;
9 # utf8_strlen, utf8_strpos, utf8_strrpos, utf8_substr,
10 # utf8_strtolower, utf8_strtoupper
13 $str = 'Iñtërnâtiônàlizætiøn';
15 print "String is: $str<br>\n";
17 # Check it's a well formed UTF-8 string
18 require_once UTF8 . '/utils/validation.php';
19 if ( utf8_is_valid($str) ) {
20 print "It's well formed UTF-8<br>\n";
22 print "It's badly formed UTF-8 - this shouldn't happen<br>\n";
25 print "Num chars: ".utf8_strlen($str)."<br>\n";
27 print "Uppercase: ".utf8_strtoupper($str)."<br>\n";
29 # Load an additional function;
30 require_once UTF8 . '/strrev.php';
32 print "Reversed: ".utf8_strrev($str)."<br>\n";