<%
header("Content-Type: text/html; charset=utf-8");
include_once( "../modules/utils.inc.php" );
$tok = $_COOKIE["c_pass_token"];
$u = $sessionUserId = $_COOKIE["c_uid"];
$id = $id ? $id : 21426;
function ufix( $s ) {
return preg_replace( "/%u([A-Fa-f0-9]{4})/", "&#x$1;", o( $s ) );
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> Unicode Test Harness </title>
<title>UTF8 ENCODER PAGE</title>
<%
$code = get_magic_quotes_gpc() ? stripslashes( $GLOBALS[code] ) : $GLOBALS[code];
%>
</head>
<body>
<% if( $name ) { %>
<p> [raw] name: <%= $name %> </p>
<p> o( name ): <%= o( $name ) %> </p>
<p> ufix( name ): <%= ufix( $name ) %> </p>
<p> ufix( %usdf): <%= ufix( "%usdf" ) %> </p>
<p> escapeQuotes( $argName): <%= escapeQuotes( $name) %> </p>
<% } %>
<form method=post action="?seed=<?=time()?>">
Original Unicode<br />
<input name="code" value="<?=$code?>"><br />
</form>
<form>
Encoded UTF8<br />
<textarea name="encd" cols="80" rows="3"><%
for( $i = 0; $i < strlen($code); $i++ ) {
echo '&#' . ord(substr($code,$i,1)) . ';';
}
%></textarea><br />
<textarea name="RAWBUTCH" cols="80" rows="3"><%
for( $i = 0; $i < strlen($code); $i++ ) {
echo dechex( ord(substr($code,$i,1))) . " ";
}
%></textarea><br />
</form>
<big>
htmlentities(): <%= htmlentities( utf8_decode( "résumé" ), ENT_NOQUOTES, "UTF-8" ) %><br />
htmlentities(): <%= htmlentities( utf8_decode( $code ), ENT_NOQUOTES, "UTF-8" ) %><br />
o(): <%= o( utf8_decode( "fooââ¢" ), ENT_NOQUOTES, "UTF-8" ) %><br />
o(): <%= o( utf8_decode( $code ), ENT_NOQUOTES, "UTF-8" ) %><br />
utf8_decode( ): <%= utf8_decode( "0xe284a2" ) %><br />
chr( 0x6f ): <%= chr( 0x6f ) %><br />
<%= hexdec( "f6" ) %><br />
&#<%= hexdec( 2122 ) %>;
&#<%= hexdec( 2019 ) %>;
<hr />
Armenian:<br />
԰
Ա
Բ
Գ
֏
Ե
Ա
Բ
<hr />
</big>
</body>
</html>